Kaydet (Commit) c5963d38 authored tarafından Kristján Valur Jónsson's avatar Kristján Valur Jónsson

Issue #15365: Make traceback reporting ignore any errors when printing out

the source line.  Such errors can't be reported anyway.  This makes error
reporting work, even if the "io" module can't be loaded.
üst 26fe37dd
...@@ -344,7 +344,10 @@ tb_displayline(PyObject *f, PyObject *filename, int lineno, PyObject *name) ...@@ -344,7 +344,10 @@ tb_displayline(PyObject *f, PyObject *filename, int lineno, PyObject *name)
Py_DECREF(line); Py_DECREF(line);
if (err != 0) if (err != 0)
return err; return err;
return _Py_DisplaySourceLine(f, filename, lineno, 4); /* ignore errors since we can't report them, can we? */
if (_Py_DisplaySourceLine(f, filename, lineno, 4))
PyErr_Clear();
return err;
} }
static int static int
......
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