mirror of
https://github.com/AdaCore/cpython.git
synced 2026-02-12 12:57:15 -08:00
Patch #50002: Display line information for bad \x escapes:
- recognize "SyntaxError"s by the print_file_and_line attribute. - add the syntaxerror attributes to all exceptions in compile.c. Fixes #221791
This commit is contained in:
@@ -920,7 +920,7 @@ void PyErr_Display(PyObject *exception, PyObject *value, PyObject *tb)
|
||||
if (tb && tb != Py_None)
|
||||
err = PyTraceBack_Print(tb, f);
|
||||
if (err == 0 &&
|
||||
PyErr_GivenExceptionMatches(exception, PyExc_SyntaxError))
|
||||
PyObject_HasAttrString(v, "print_file_and_line"))
|
||||
{
|
||||
PyObject *message;
|
||||
char *filename, *text;
|
||||
|
||||
Reference in New Issue
Block a user