diff options
author | Jeroen Demeyer <J.Demeyer@UGent.be> | 2019-07-11 08:59:05 (GMT) |
---|---|---|
committer | Inada Naoki <songofacandy@gmail.com> | 2019-07-11 08:59:05 (GMT) |
commit | 59ad110d7a7784d53d0b502eebce0346597a6bef (patch) | |
tree | 8ccd39e358017efe2abe41912c2f9d567ee9f248 /Python/import.c | |
parent | 2a3d4d9c53dd4831c3ecf56bc7c4a289c33030d6 (diff) | |
download | cpython-59ad110d7a7784d53d0b502eebce0346597a6bef.zip cpython-59ad110d7a7784d53d0b502eebce0346597a6bef.tar.gz cpython-59ad110d7a7784d53d0b502eebce0346597a6bef.tar.bz2 |
bpo-37547: add _PyObject_CallMethodOneArg (GH-14685)
Diffstat (limited to 'Python/import.c')
-rw-r--r-- | Python/import.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/Python/import.c b/Python/import.c index df25875..15f1d94 100644 --- a/Python/import.c +++ b/Python/import.c @@ -962,9 +962,8 @@ PyImport_ExecCodeModuleWithPathnames(const char *name, PyObject *co, external= PyObject_GetAttrString(interp->importlib, "_bootstrap_external"); if (external != NULL) { - pathobj = _PyObject_CallMethodIdObjArgs(external, - &PyId__get_sourcefile, cpathobj, - NULL); + pathobj = _PyObject_CallMethodIdOneArg( + external, &PyId__get_sourcefile, cpathobj); Py_DECREF(external); } if (pathobj == NULL) @@ -1827,9 +1826,8 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *globals, */ spec = _PyObject_GetAttrId(mod, &PyId___spec__); if (_PyModuleSpec_IsInitializing(spec)) { - PyObject *value = _PyObject_CallMethodIdObjArgs(interp->importlib, - &PyId__lock_unlock_module, abs_name, - NULL); + PyObject *value = _PyObject_CallMethodIdOneArg( + interp->importlib, &PyId__lock_unlock_module, abs_name); if (value == NULL) { Py_DECREF(spec); goto error; @@ -1968,7 +1966,7 @@ PyImport_ReloadModule(PyObject *m) } } - reloaded_module = _PyObject_CallMethodIdObjArgs(imp, &PyId_reload, m, NULL); + reloaded_module = _PyObject_CallMethodIdOneArg(imp, &PyId_reload, m); Py_DECREF(imp); return reloaded_module; } |