From a33c1e69bcc2312323114e06b2fcd5d4ba900f8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= 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/exceptions.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Python/exceptions.c') diff --git a/Python/exceptions.c b/Python/exceptions.c index 99002bf1ad..adfd699320 100644 --- a/Python/exceptions.c +++ b/Python/exceptions.c @@ -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; } -- cgit v1.2.1