summaryrefslogtreecommitdiff
path: root/Python/exceptions.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2002-03-03 21:30:27 +0000
committerMartin v. Löwis <martin@v.loewis.de>2002-03-03 21:30:27 +0000
commita33c1e69bcc2312323114e06b2fcd5d4ba900f8d (patch)
treeead518f9ffd9a0d6058358eee42399b870d98ab7 /Python/exceptions.c
parent5393a9d4fbfeacc988f09e03411c052bc0768253 (diff)
downloadcpython-a33c1e69bcc2312323114e06b2fcd5d4ba900f8d.tar.gz
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
Diffstat (limited to 'Python/exceptions.c')
-rw-r--r--Python/exceptions.c3
1 files changed, 2 insertions, 1 deletions
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;
}