mirror of
https://github.com/python/cpython.git
synced 2025-08-24 18:55:00 +00: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:
parent
290d31e2fc
commit
cfeb3b6ab8
5 changed files with 55 additions and 17 deletions
|
@ -670,7 +670,8 @@ SyntaxError__classinit__(PyObject *klass)
|
|||
PyObject_SetAttrString(klass, "filename", Py_None) ||
|
||||
PyObject_SetAttrString(klass, "lineno", Py_None) ||
|
||||
PyObject_SetAttrString(klass, "offset", Py_None) ||
|
||||
PyObject_SetAttrString(klass, "text", Py_None))
|
||||
PyObject_SetAttrString(klass, "text", Py_None) ||
|
||||
PyObject_SetAttrString(klass, "print_file_and_line", Py_None))
|
||||
{
|
||||
retval = -1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue