summaryrefslogtreecommitdiffstats
path: root/Python/exceptions.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2002-03-03 21:32:01 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2002-03-03 21:32:01 (GMT)
commit59509f511ed8eacbefecc4357c69036fc036effe (patch)
tree79ebe91082f869304032021b166d9898a3eb778d /Python/exceptions.c
parentebaaf187114625811ed7c7a1791f9cb77186d545 (diff)
downloadcpython-59509f511ed8eacbefecc4357c69036fc036effe.zip
cpython-59509f511ed8eacbefecc4357c69036fc036effe.tar.gz
cpython-59509f511ed8eacbefecc4357c69036fc036effe.tar.bz2
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 99002bf..adfd699 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;
}