mirror of
https://github.com/python/cpython.git
synced 2025-10-21 22:22:48 +00:00
Simplify sys.breakpointhook implementation (#9519)
This commit is contained in:
parent
bf46a09dec
commit
dce345c51a
1 changed files with 1 additions and 9 deletions
|
@ -151,16 +151,8 @@ sys_breakpointhook(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyOb
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
PyObject *fromlist = Py_BuildValue("(s)", attrname);
|
PyObject *module = PyImport_Import(modulepath);
|
||||||
if (fromlist == NULL) {
|
|
||||||
Py_DECREF(modulepath);
|
|
||||||
PyMem_RawFree(envar);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
PyObject *module = PyImport_ImportModuleLevelObject(
|
|
||||||
modulepath, NULL, NULL, fromlist, 0);
|
|
||||||
Py_DECREF(modulepath);
|
Py_DECREF(modulepath);
|
||||||
Py_DECREF(fromlist);
|
|
||||||
|
|
||||||
if (module == NULL) {
|
if (module == NULL) {
|
||||||
goto error;
|
goto error;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue