commit | e07f4ab26aaf08f90ebd9e6004af14fd6ef39351 | [log] [tgz] |
---|---|---|
author | Pablo Galindo <Pablogsal@gmail.com> | Wed Apr 14 18:58:28 2021 +0100 |
committer | GitHub <noreply@github.com> | Wed Apr 14 18:58:28 2021 +0100 |
tree | 65903b0467e6fa1eb88b76f0adb17927f8d61e74 | |
parent | 0c4c43632556a5ea5ef2267efeb17b332b861a19 [diff] [blame] |
bpo-38530: Make sure that failing to generate suggestions on failure will not propagate exceptions (GH-25408)
diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 321b04e..6f84cab 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c
@@ -962,6 +962,8 @@ print_exception(PyObject *f, PyObject *value) err += PyFile_WriteString("?", f); } Py_DECREF(suggestions); + } else if (PyErr_Occurred()) { + PyErr_Clear(); } err += PyFile_WriteString("\n", f); Py_XDECREF(tb);