diff options
Diffstat (limited to 'Python/sysmodule.c')
| -rw-r--r-- | Python/sysmodule.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c index efe5b29..75e4f4b 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -171,6 +171,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( |
