bpo-37483: add _PyObject_CallOneArg() function (#14558)
diff --git a/Objects/abstract.c b/Objects/abstract.c
index 77d0914..86178a7 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -172,13 +172,13 @@
}
if (PyType_Check(o)) {
- PyObject *meth, *result, *stack[1] = {key};
+ PyObject *meth, *result;
_Py_IDENTIFIER(__class_getitem__);
if (_PyObject_LookupAttrId(o, &PyId___class_getitem__, &meth) < 0) {
return NULL;
}
if (meth) {
- result = _PyObject_FastCall(meth, stack, 1);
+ result = _PyObject_CallOneArg(meth, key);
Py_DECREF(meth);
return result;
}
@@ -737,7 +737,7 @@
}
/* And call it. */
- result = PyObject_CallFunctionObjArgs(meth, format_spec, NULL);
+ result = _PyObject_CallOneArg(meth, format_spec);
Py_DECREF(meth);
if (result && !PyUnicode_Check(result)) {
@@ -2459,7 +2459,7 @@
Py_DECREF(checker);
return ok;
}
- res = PyObject_CallFunctionObjArgs(checker, inst, NULL);
+ res = _PyObject_CallOneArg(checker, inst);
Py_LeaveRecursiveCall();
Py_DECREF(checker);
if (res != NULL) {
@@ -2533,7 +2533,7 @@
Py_DECREF(checker);
return ok;
}
- res = PyObject_CallFunctionObjArgs(checker, derived, NULL);
+ res = _PyObject_CallOneArg(checker, derived);
Py_LeaveRecursiveCall();
Py_DECREF(checker);
if (res != NULL) {