Unverified Kaydet (Commit) 6fe9c446 authored tarafından Serhiy Storchaka's avatar Serhiy Storchaka Kaydeden (comit) GitHub

bpo-34756: Silence only ImportError and AttributeError in sys.breakpointhook(). (GH-9457)

üst 454b3d4e
...@@ -170,6 +170,12 @@ sys_breakpointhook(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyOb ...@@ -170,6 +170,12 @@ sys_breakpointhook(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyOb
return retval; return retval;
error: 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. */ /* If any of the imports went wrong, then warn and ignore. */
PyErr_Clear(); PyErr_Clear();
int status = PyErr_WarnFormat( int status = PyErr_WarnFormat(
......
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