diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2002-03-03 21:32:01 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2002-03-03 21:32:01 (GMT) |
commit | 59509f511ed8eacbefecc4357c69036fc036effe (patch) | |
tree | 79ebe91082f869304032021b166d9898a3eb778d /Python/pythonrun.c | |
parent | ebaaf187114625811ed7c7a1791f9cb77186d545 (diff) | |
download | cpython-59509f511ed8eacbefecc4357c69036fc036effe.zip cpython-59509f511ed8eacbefecc4357c69036fc036effe.tar.gz cpython-59509f511ed8eacbefecc4357c69036fc036effe.tar.bz2 |
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
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r-- | Python/pythonrun.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 6b70739..ad92004 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -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; |