summaryrefslogtreecommitdiffstats
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2021-04-14 17:58:28 (GMT)
committerGitHub <noreply@github.com>2021-04-14 17:58:28 (GMT)
commite07f4ab26aaf08f90ebd9e6004af14fd6ef39351 (patch)
tree65903b0467e6fa1eb88b76f0adb17927f8d61e74 /Python/pythonrun.c
parent0c4c43632556a5ea5ef2267efeb17b332b861a19 (diff)
downloadcpython-e07f4ab26aaf08f90ebd9e6004af14fd6ef39351.zip
cpython-e07f4ab26aaf08f90ebd9e6004af14fd6ef39351.tar.gz
cpython-e07f4ab26aaf08f90ebd9e6004af14fd6ef39351.tar.bz2
bpo-38530: Make sure that failing to generate suggestions on failure will not propagate exceptions (GH-25408)
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r--Python/pythonrun.c2
1 files changed, 2 insertions, 0 deletions
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);