bpo-37337: Add _PyObject_CallMethodNoArgs() (GH-14267)
diff --git a/Modules/_posixsubprocess.c b/Modules/_posixsubprocess.c
index 81a23c6..60c8eab 100644
--- a/Modules/_posixsubprocess.c
+++ b/Modules/_posixsubprocess.c
@@ -60,7 +60,7 @@
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 @@
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 @@
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;