summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-10-30 09:17:27 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-10-30 09:17:27 (GMT)
commit5e78f4daa8d4d6b2813401fbb6846929941e9a57 (patch)
tree1b6ca0bef23245bb5ed0b61f1fc91a9dc56f2865
parent2acbae80165390a5be3bb12351147b8026787e13 (diff)
downloadcpython-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.c1
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;
}