diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2002-03-03 21:32:01 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2002-03-03 21:32:01 (GMT) |
commit | 59509f511ed8eacbefecc4357c69036fc036effe (patch) | |
tree | 79ebe91082f869304032021b166d9898a3eb778d /Python/exceptions.c | |
parent | ebaaf187114625811ed7c7a1791f9cb77186d545 (diff) | |
download | cpython-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.c | 3 |
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; } |