bpo-37337: Add _PyObject_CallMethodNoArgs() (GH-14267)

This commit is contained in:
Jeroen Demeyer 2019-07-08 10:19:25 +02:00 committed by Inada Naoki
parent 38f44b4a4a
commit 762f93ff2e
37 changed files with 154 additions and 132 deletions

View file

@ -60,7 +60,7 @@ _enable_gc(int need_to_reenable_gc, PyObject *gc_module)
if (need_to_reenable_gc) {
PyErr_Fetch(&exctype, &val, &tb);
result = _PyObject_CallMethodId(gc_module, &PyId_enable, NULL);
result = _PyObject_CallMethodIdNoArgs(gc_module, &PyId_enable);
if (exctype != NULL) {
PyErr_Restore(exctype, val, tb);
}
@ -606,7 +606,7 @@ subprocess_fork_exec(PyObject* self, PyObject *args)
gc_module = PyImport_ImportModule("gc");
if (gc_module == NULL)
return NULL;
result = _PyObject_CallMethodId(gc_module, &PyId_isenabled, NULL);
result = _PyObject_CallMethodIdNoArgs(gc_module, &PyId_isenabled);
if (result == NULL) {
Py_DECREF(gc_module);
return NULL;
@ -617,7 +617,7 @@ subprocess_fork_exec(PyObject* self, PyObject *args)
Py_DECREF(gc_module);
return NULL;
}
result = _PyObject_CallMethodId(gc_module, &PyId_disable, NULL);
result = _PyObject_CallMethodIdNoArgs(gc_module, &PyId_disable);
if (result == NULL) {
Py_DECREF(gc_module);
return NULL;