bpo-37547: add _PyObject_CallMethodOneArg (GH-14685)
diff --git a/Modules/_abc.c b/Modules/_abc.c
index 219ea0d..7b5d418 100644
--- a/Modules/_abc.c
+++ b/Modules/_abc.c
@@ -480,7 +480,6 @@
/*[clinic end generated code: output=b8b5148f63b6b56f input=a4f4525679261084]*/
{
PyObject *subtype, *result = NULL, *subclass = NULL;
- PyObject *margs[2];
_abc_data *impl = _get_impl(self);
if (impl == NULL) {
return NULL;
@@ -515,16 +514,12 @@
}
}
/* Fall back to the subclass check. */
- margs[0] = self;
- margs[1] = subclass;
- result = _PyObject_VectorcallMethodId(&PyId___subclasscheck__, margs,
- 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
+ result = _PyObject_CallMethodIdOneArg(self, &PyId___subclasscheck__,
+ subclass);
goto end;
}
- margs[0] = self;
- margs[1] = subclass;
- result = _PyObject_VectorcallMethodId(&PyId___subclasscheck__, margs,
- 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
+ result = _PyObject_CallMethodIdOneArg(self, &PyId___subclasscheck__,
+ subclass);
if (result == NULL) {
goto end;
}
@@ -536,10 +531,8 @@
break;
case 0:
Py_DECREF(result);
- margs[0] = self;
- margs[1] = subtype;
- result = _PyObject_VectorcallMethodId(&PyId___subclasscheck__, margs,
- 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
+ result = _PyObject_CallMethodIdOneArg(self, &PyId___subclasscheck__,
+ subtype);
break;
case 1: // Nothing to do.
break;
@@ -620,8 +613,8 @@
}
/* 3. Check the subclass hook. */
- ok = _PyObject_CallMethodIdObjArgs((PyObject *)self, &PyId___subclasshook__,
- subclass, NULL);
+ ok = _PyObject_CallMethodIdOneArg((PyObject *)self, &PyId___subclasshook__,
+ subclass);
if (ok == NULL) {
goto end;
}