mirror of
https://github.com/python/cpython.git
synced 2026-04-23 04:11:18 +00:00
bpo-34756: Silence only ImportError and AttributeError in sys.breakpointhook(). (GH-9457)
(cherry picked from commit 6fe9c446f8)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
26122de1a8
commit
6d0254bae4
1 changed files with 6 additions and 0 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue