mirror of
https://github.com/python/cpython.git
synced 2025-08-30 05:35:08 +00:00
bpo-34756: Silence only ImportError and AttributeError in sys.breakpointhook(). (GH-9457)
This commit is contained in:
parent
454b3d4ea2
commit
6fe9c446f8
1 changed files with 6 additions and 0 deletions
|
@ -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(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue