diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2002-03-03 21:30:27 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2002-03-03 21:30:27 (GMT) |
commit | cfeb3b6ab8e213cb3551b101d0566d77f5b47409 (patch) | |
tree | 657521ff13e38d11dd10535827b4272af965b856 /Python/pythonrun.c | |
parent | 290d31e2fc02a0d887da2c76fbe4e72377442a0a (diff) | |
download | cpython-cfeb3b6ab8e213cb3551b101d0566d77f5b47409.zip cpython-cfeb3b6ab8e213cb3551b101d0566d77f5b47409.tar.gz cpython-cfeb3b6ab8e213cb3551b101d0566d77f5b47409.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; |