bpo-34756: Silence only ImportError and AttributeError in sys.breakpointhook(). (GH-9457)
This commit is contained in:
parent
454b3d4ea2
commit
6fe9c446f8
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue