summaryrefslogtreecommitdiffstats
path: root/Objects/abstract.c
diff options
context:
space:
mode:
authorJeroen Demeyer <J.Demeyer@UGent.be>2019-07-04 10:31:34 (GMT)
committerInada Naoki <songofacandy@gmail.com>2019-07-04 10:31:34 (GMT)
commit196a530e00d88a138973bf9182e013937e293f97 (patch)
tree35443abb5aa148b459f68ae43a18cdbb0627ba76 /Objects/abstract.c
parent9d40554e0da09a44a8547f3f3a2b9dedfeaf7928 (diff)
downloadcpython-196a530e00d88a138973bf9182e013937e293f97.zip
cpython-196a530e00d88a138973bf9182e013937e293f97.tar.gz
cpython-196a530e00d88a138973bf9182e013937e293f97.tar.bz2
bpo-37483: add _PyObject_CallOneArg() function (#14558)
Diffstat (limited to 'Objects/abstract.c')
-rw-r--r--Objects/abstract.c10
1 files changed, 5 insertions, 5 deletions
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 @@ PyObject_GetItem(PyObject *o, PyObject *key)
}
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 @@ PyObject_Format(PyObject *obj, PyObject *format_spec)
}
/* 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 @@ PyObject_IsInstance(PyObject *inst, PyObject *cls)
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 @@ PyObject_IsSubclass(PyObject *derived, PyObject *cls)
Py_DECREF(checker);
return ok;
}
- res = PyObject_CallFunctionObjArgs(checker, derived, NULL);
+ res = _PyObject_CallOneArg(checker, derived);
Py_LeaveRecursiveCall();
Py_DECREF(checker);
if (res != NULL) {