]> granicus.if.org Git - python/commitdiff
Issue #22762: Fix _Py_DisplaySourceLine(), clear the exception if
authorVictor Stinner <victor.stinner@gmail.com>
Thu, 30 Oct 2014 09:17:27 +0000 (10:17 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Thu, 30 Oct 2014 09:17:27 +0000 (10:17 +0100)
PyFile_GetLine() failed. Patch written by Xavier de Gaye.

Python/traceback.c

index bbe6f2eebbd428606c1891d9bd35e07e74ecc31b..c2aba522bf6c5ccf084b3f9dc5136e40711816df 100644 (file)
@@ -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;
         }