From cfeb3b6ab8e213cb3551b101d0566d77f5b47409 Mon Sep 17 00:00:00 2001 From: "Martin v. Löwis" Date: Sun, 3 Mar 2002 21:30:27 +0000 Subject: 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 --- Python/pythonrun.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Python/pythonrun.c') diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 6b70739d0a2..ad92004f9a5 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; -- cgit v1.2.3