Issue #22762: Fix _Py_DisplaySourceLine(), clear the exception if

PyFile_GetLine() failed. Patch written by Xavier de Gaye.
This commit is contained in:
Victor Stinner 2014-10-30 10:17:27 +01:00
parent 2acbae8016
commit 5e78f4daa8
1 changed files with 1 additions and 0 deletions

View 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;
}