Mercurial > cpython-lru_cache-weakref
diff Python/pythonrun.c @ 22121:d4406fbfcb4e 2.2
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
| author | Martin v. Löwis <martin@v.loewis.de> |
|---|---|
| date | Sun, 03 Mar 2002 21:32:01 +0000 |
| parents | e223397b26fa |
| children | c0dd8bbdde60 eebae4f60d05 |
line wrap: on
line diff
--- a/Python/pythonrun.c Sun Mar 03 15:17:07 2002 +0000 +++ b/Python/pythonrun.c Sun Mar 03 21:32:01 2002 +0000 @@ -920,7 +920,7 @@ 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;
