diff options
author | Irit Katriel <1055913+iritkatriel@users.noreply.github.com> | 2021-11-05 09:39:18 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-05 09:39:18 (GMT) |
commit | 3509b26c916707363c71a1df040855e395cf4817 (patch) | |
tree | 9b61a408b78e8133e7b75ac5fb18e093c88b4698 /Include/internal | |
parent | e52f9bee802aa7a7fbd405dcc43bc2d1bea884d9 (diff) | |
download | cpython-3509b26c916707363c71a1df040855e395cf4817.zip cpython-3509b26c916707363c71a1df040855e395cf4817.tar.gz cpython-3509b26c916707363c71a1df040855e395cf4817.tar.bz2 |
bpo-45292: [PEP 654] Update traceback display code to work with exception groups (GH-29207)
Diffstat (limited to 'Include/internal')
-rw-r--r-- | Include/internal/pycore_traceback.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Include/internal/pycore_traceback.h b/Include/internal/pycore_traceback.h index c01a476..84dbe27 100644 --- a/Include/internal/pycore_traceback.h +++ b/Include/internal/pycore_traceback.h @@ -87,6 +87,17 @@ PyAPI_FUNC(PyObject*) _PyTraceBack_FromFrame( PyObject *tb_next, PyFrameObject *frame); +#define EXCEPTION_TB_HEADER "Traceback (most recent call last):\n" +#define EXCEPTION_GROUP_TB_HEADER "Exception Group Traceback (most recent call last):\n" + +/* Write the traceback tb to file f. Prefix each line with + indent spaces followed by the margin (if it is not NULL). */ +PyAPI_FUNC(int) _PyTraceBack_Print_Indented( + PyObject *tb, int indent, const char* margin, + const char *header_margin, const char *header, PyObject *f); +PyAPI_FUNC(int) _Py_WriteIndentedMargin(int, const char*, PyObject *); +PyAPI_FUNC(int) _Py_WriteIndent(int, PyObject *); + #ifdef __cplusplus } #endif |