From 5e78f4daa8d4d6b2813401fbb6846929941e9a57 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 30 Oct 2014 10:17:27 +0100 Subject: [PATCH] Issue #22762: Fix _Py_DisplaySourceLine(), clear the exception if PyFile_GetLine() failed. Patch written by Xavier de Gaye. --- Python/traceback.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Python/traceback.c b/Python/traceback.c index bbe6f2eebbd..c2aba522bf6 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; }