diff Python/exceptions.c @ 22120:b2a2cc0c2a63 legacy-trunk

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:30:27 +0000
parents d4406fbfcb4e
children 2bfe44c4dacb 7230e01c3c49
line wrap: on
line diff
--- a/Python/exceptions.c	Sun Mar 03 15:12:58 2002 +0000
+++ b/Python/exceptions.c	Sun Mar 03 21:30:27 2002 +0000
@@ -670,7 +670,8 @@
 	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;
     }