summaryrefslogtreecommitdiffstats
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 10707fd..869834b 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -170,6 +170,12 @@ sys_breakpointhook(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyOb
return retval;
error:
+ if (!PyErr_ExceptionMatches(PyExc_ImportError)
+ && !PyErr_ExceptionMatches(PyExc_AttributeError))
+ {
+ PyMem_RawFree(envar);
+ return NULL;
+ }
/* If any of the imports went wrong, then warn and ignore. */
PyErr_Clear();
int status = PyErr_WarnFormat(