summaryrefslogtreecommitdiff
path: root/Modules/_abc.c
diff options
context:
space:
mode:
authorJeroen Demeyer <J.Demeyer@UGent.be>2019-07-11 10:59:05 +0200
committerInada Naoki <songofacandy@gmail.com>2019-07-11 17:59:05 +0900
commit59ad110d7a7784d53d0b502eebce0346597a6bef (patch)
tree8ccd39e358017efe2abe41912c2f9d567ee9f248 /Modules/_abc.c
parent2a3d4d9c53dd4831c3ecf56bc7c4a289c33030d6 (diff)
downloadcpython-git-59ad110d7a7784d53d0b502eebce0346597a6bef.tar.gz
bpo-37547: add _PyObject_CallMethodOneArg (GH-14685)
Diffstat (limited to 'Modules/_abc.c')
-rw-r--r--Modules/_abc.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/Modules/_abc.c b/Modules/_abc.c
index 219ea0dd62..7b5d4180bf 100644
--- a/Modules/_abc.c
+++ b/Modules/_abc.c
@@ -480,7 +480,6 @@ _abc__abc_instancecheck_impl(PyObject *module, PyObject *self,
/*[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 @@ _abc__abc_instancecheck_impl(PyObject *module, PyObject *self,
}
}
/* 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 @@ _abc__abc_instancecheck_impl(PyObject *module, PyObject *self,
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 @@ _abc__abc_subclasscheck_impl(PyObject *module, PyObject *self,
}
/* 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;
}