diff Python/exceptions.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 639c0a3ae8dc
children 2bfe44c4dacb 7230e01c3c49
line wrap: on
line diff
--- a/Python/exceptions.c	Sun Mar 03 15:17:07 2002 +0000
+++ b/Python/exceptions.c	Sun Mar 03 21:32:01 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;
     }