Use _PyObject_CallMethodIdObjArgs()

Issue #28915: Replace _PyObject_CallMethodId() with
_PyObject_CallMethodIdObjArgs() in various modules when the format string was
only made of "O" formats, PyObject* arguments.

_PyObject_CallMethodIdObjArgs() avoids the creation of a temporary tuple and
doesn't have to parse a format string.
This commit is contained in:
Victor Stinner 2016-12-09 16:09:30 +01:00
parent 61bdb0d319
commit 55ba38a480
6 changed files with 9 additions and 9 deletions

View file

@ -1705,7 +1705,7 @@ PyImport_ReloadModule(PyObject *m)
Py_INCREF(imp);
}
reloaded_module = _PyObject_CallMethodId(imp, &PyId_reload, "O", m);
reloaded_module = _PyObject_CallMethodIdObjArgs(imp, &PyId_reload, m, NULL);
Py_DECREF(imp);
return reloaded_module;
}