Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dce345c

Browse files
asottilewarsaw
authored andcommitted
Simplify sys.breakpointhook implementation (#9519)
1 parent bf46a09 commit dce345c

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

Python/sysmodule.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -151,16 +151,8 @@ sys_breakpointhook(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyOb
151151
return NULL;
152152
}
153153

154-
PyObject *fromlist = Py_BuildValue("(s)", attrname);
155-
if (fromlist == NULL) {
156-
Py_DECREF(modulepath);
157-
PyMem_RawFree(envar);
158-
return NULL;
159-
}
160-
PyObject *module = PyImport_ImportModuleLevelObject(
161-
modulepath, NULL, NULL, fromlist, 0);
154+
PyObject *module = PyImport_Import(modulepath);
162155
Py_DECREF(modulepath);
163-
Py_DECREF(fromlist);
164156

165157
if (module == NULL) {
166158
goto error;

0 commit comments

Comments
 (0)