mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
bpo-37337: Add _PyObject_CallMethodNoArgs() (GH-14267)
This commit is contained in:
parent
38f44b4a4a
commit
762f93ff2e
37 changed files with 154 additions and 132 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue