diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-10-30 09:17:27 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-10-30 09:17:27 (GMT) |
commit | 5e78f4daa8d4d6b2813401fbb6846929941e9a57 (patch) | |
tree | 1b6ca0bef23245bb5ed0b61f1fc91a9dc56f2865 | |
parent | 2acbae80165390a5be3bb12351147b8026787e13 (diff) | |
download | cpython-5e78f4daa8d4d6b2813401fbb6846929941e9a57.zip cpython-5e78f4daa8d4d6b2813401fbb6846929941e9a57.tar.gz cpython-5e78f4daa8d4d6b2813401fbb6846929941e9a57.tar.bz2 |
Issue #22762: Fix _Py_DisplaySourceLine(), clear the exception if
PyFile_GetLine() failed. Patch written by Xavier de Gaye.
-rw-r--r-- | Python/traceback.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Python/traceback.c b/Python/traceback.c index bbe6f2e..c2aba52 100644 --- a/Python/traceback.c +++ b/Python/traceback.c @@ -322,6 +322,7 @@ _Py_DisplaySourceLine(PyObject *f, PyObject *filename, int lineno, int indent) Py_XDECREF(lineobj); lineobj = PyFile_GetLine(fob, -1); if (!lineobj) { + PyErr_Clear(); err = -1; break; } |