bpo-45292: [PEP 654] Update traceback display code to work with exception groups (GH-29207)

This commit is contained in:
Irit Katriel 2021-11-05 09:39:18 +00:00 committed by GitHub
parent e52f9bee80
commit 3509b26c91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 1017 additions and 87 deletions

View file

@ -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