summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnthony Sottile <asottile@umich.edu>2018-11-01 17:25:05 (GMT)
committerBarry Warsaw <barry@python.org>2018-11-01 17:25:05 (GMT)
commitdce345c51abd5081679a487315fb47efddc54cdb (patch)
treea6a21a6ed8daf4128f3f1a2c3ee6527813a0a8a8
parentbf46a09dec372b85846216bd692d648dac08ac36 (diff)
downloadcpython-dce345c51abd5081679a487315fb47efddc54cdb.zip
cpython-dce345c51abd5081679a487315fb47efddc54cdb.tar.gz
cpython-dce345c51abd5081679a487315fb47efddc54cdb.tar.bz2
Simplify sys.breakpointhook implementation (#9519)
-rw-r--r--Python/sysmodule.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 2164708..c0f168c 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -151,16 +151,8 @@ sys_breakpointhook(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyOb
return NULL;
}
- PyObject *fromlist = Py_BuildValue("(s)", attrname);
- if (fromlist == NULL) {
- Py_DECREF(modulepath);
- PyMem_RawFree(envar);
- return NULL;
- }
- PyObject *module = PyImport_ImportModuleLevelObject(
- modulepath, NULL, NULL, fromlist, 0);
+ PyObject *module = PyImport_Import(modulepath);
Py_DECREF(modulepath);
- Py_DECREF(fromlist);
if (module == NULL) {
goto error;