summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorJeroen Demeyer <J.Demeyer@UGent.be>2019-06-28 09:49:00 (GMT)
committerInada Naoki <songofacandy@gmail.com>2019-06-28 09:49:00 (GMT)
commitb1263d5a60d3f7ab02dd28409fff59b3815a3f67 (patch)
treed2b48c8ffcf6b8d4c042495e0b8888b7deda086e /Modules
parentb4bee03087a3c70cb040e2ce569c828860ed8e87 (diff)
downloadcpython-b1263d5a60d3f7ab02dd28409fff59b3815a3f67.zip
cpython-b1263d5a60d3f7ab02dd28409fff59b3815a3f67.tar.gz
cpython-b1263d5a60d3f7ab02dd28409fff59b3815a3f67.tar.bz2
bpo-37337: Add _PyObject_VectorcallMethod() (GH-14228)
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_abc.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/Modules/_abc.c b/Modules/_abc.c
index 1fbf3a8..7233690 100644
--- a/Modules/_abc.c
+++ b/Modules/_abc.c
@@ -480,6 +480,7 @@ _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;
@@ -514,12 +515,16 @@ _abc__abc_instancecheck_impl(PyObject *module, PyObject *self,
}
}
/* Fall back to the subclass check. */
- result = _PyObject_CallMethodIdObjArgs(self, &PyId___subclasscheck__,
- subclass, NULL);
+ margs[0] = self;
+ margs[1] = subclass;
+ result = _PyObject_VectorcallMethodId(&PyId___subclasscheck__, margs,
+ 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
goto end;
}
- result = _PyObject_CallMethodIdObjArgs(self, &PyId___subclasscheck__,
- subclass, NULL);
+ margs[0] = self;
+ margs[1] = subclass;
+ result = _PyObject_VectorcallMethodId(&PyId___subclasscheck__, margs,
+ 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
if (result == NULL) {
goto end;
}
@@ -531,8 +536,10 @@ _abc__abc_instancecheck_impl(PyObject *module, PyObject *self,
break;
case 0:
Py_DECREF(result);
- result = _PyObject_CallMethodIdObjArgs(self, &PyId___subclasscheck__,
- subtype, NULL);
+ margs[0] = self;
+ margs[1] = subtype;
+ result = _PyObject_VectorcallMethodId(&PyId___subclasscheck__, margs,
+ 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
break;
case 1: // Nothing to do.
break;