Commit 5e78f4da authored by Victor Stinner's avatar Victor Stinner

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

PyFile_GetLine() failed. Patch written by Xavier de Gaye.
parent 2acbae80
...@@ -322,6 +322,7 @@ _Py_DisplaySourceLine(PyObject *f, PyObject *filename, int lineno, int indent) ...@@ -322,6 +322,7 @@ _Py_DisplaySourceLine(PyObject *f, PyObject *filename, int lineno, int indent)
Py_XDECREF(lineobj); Py_XDECREF(lineobj);
lineobj = PyFile_GetLine(fob, -1); lineobj = PyFile_GetLine(fob, -1);
if (!lineobj) { if (!lineobj) {
PyErr_Clear();
err = -1; err = -1;
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment