From: Victor Stinner Date: Thu, 30 Oct 2014 09:17:27 +0000 (+0100) Subject: Issue #22762: Fix _Py_DisplaySourceLine(), clear the exception if X-Git-Tag: v3.5.0a1~576^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5e78f4daa8d4d6b2813401fbb6846929941e9a57;p=python Issue #22762: Fix _Py_DisplaySourceLine(), clear the exception if PyFile_GetLine() failed. Patch written by Xavier de Gaye. --- diff --git a/Python/traceback.c b/Python/traceback.c index bbe6f2eebb..c2aba522bf 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; }