summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorJeroen Demeyer <J.Demeyer@UGent.be>2019-07-08 08:19:25 (GMT)
committerInada Naoki <songofacandy@gmail.com>2019-07-08 08:19:25 (GMT)
commit762f93ff2efd6b7ef0177cad57939c0ab2002eac (patch)
tree4811b08fa9342c3b2575de7e7c1030d1d5eea8a0 /Objects
parent38f44b4a4adc37e8f5f8971917d8b3145f351a56 (diff)
downloadcpython-762f93ff2efd6b7ef0177cad57939c0ab2002eac.zip
cpython-762f93ff2efd6b7ef0177cad57939c0ab2002eac.tar.gz
cpython-762f93ff2efd6b7ef0177cad57939c0ab2002eac.tar.bz2
bpo-37337: Add _PyObject_CallMethodNoArgs() (GH-14267)
Diffstat (limited to 'Objects')
-rw-r--r--Objects/abstract.c2
-rw-r--r--Objects/descrobject.c8
-rw-r--r--Objects/fileobject.c2
-rw-r--r--Objects/odictobject.c6
-rw-r--r--Objects/typeobject.c2
-rw-r--r--Objects/weakrefobject.c2
6 files changed, 11 insertions, 11 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c
index 86178a7..db1c306 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -2221,7 +2221,7 @@ method_output_as_list(PyObject *o, _Py_Identifier *meth_id)
PyObject *it, *result, *meth_output;
assert(o != NULL);
- meth_output = _PyObject_CallMethodId(o, meth_id, NULL);
+ meth_output = _PyObject_CallMethodIdNoArgs(o, meth_id);
if (meth_output == NULL || PyList_CheckExact(meth_output)) {
return meth_output;
}
diff --git a/Objects/descrobject.c b/Objects/descrobject.c
index 99855d8..edce250 100644
--- a/Objects/descrobject.c
+++ b/Objects/descrobject.c
@@ -1019,28 +1019,28 @@ static PyObject *
mappingproxy_keys(mappingproxyobject *pp, PyObject *Py_UNUSED(ignored))
{
_Py_IDENTIFIER(keys);
- return _PyObject_CallMethodId(pp->mapping, &PyId_keys, NULL);
+ return _PyObject_CallMethodIdNoArgs(pp->mapping, &PyId_keys);
}
static PyObject *
mappingproxy_values(mappingproxyobject *pp, PyObject *Py_UNUSED(ignored))
{
_Py_IDENTIFIER(values);
- return _PyObject_CallMethodId(pp->mapping, &PyId_values, NULL);
+ return _PyObject_CallMethodIdNoArgs(pp->mapping, &PyId_values);
}
static PyObject *
mappingproxy_items(mappingproxyobject *pp, PyObject *Py_UNUSED(ignored))
{
_Py_IDENTIFIER(items);
- return _PyObject_CallMethodId(pp->mapping, &PyId_items, NULL);
+ return _PyObject_CallMethodIdNoArgs(pp->mapping, &PyId_items);
}
static PyObject *
mappingproxy_copy(mappingproxyobject *pp, PyObject *Py_UNUSED(ignored))
{
_Py_IDENTIFIER(copy);
- return _PyObject_CallMethodId(pp->mapping, &PyId_copy, NULL);
+ return _PyObject_CallMethodIdNoArgs(pp->mapping, &PyId_copy);
}
/* WARNING: mappingproxy methods must not give access
diff --git a/Objects/fileobject.c b/Objects/fileobject.c
index a21e490..0faf7e7 100644
--- a/Objects/fileobject.c
+++ b/Objects/fileobject.c
@@ -61,7 +61,7 @@ PyFile_GetLine(PyObject *f, int n)
}
if (n <= 0) {
- result = _PyObject_CallMethodIdObjArgs(f, &PyId_readline, NULL);
+ result = _PyObject_CallMethodIdNoArgs(f, &PyId_readline);
}
else {
result = _PyObject_CallMethodId(f, &PyId_readline, "i", n);
diff --git a/Objects/odictobject.c b/Objects/odictobject.c
index 4c9ae3b..dfbd30a 100644
--- a/Objects/odictobject.c
+++ b/Objects/odictobject.c
@@ -920,7 +920,7 @@ odict_reduce(register PyODictObject *od, PyObject *Py_UNUSED(ignored))
if (args == NULL)
goto Done;
- items = _PyObject_CallMethodIdObjArgs((PyObject *)od, &PyId_items, NULL);
+ items = _PyObject_CallMethodIdNoArgs((PyObject *)od, &PyId_items);
if (items == NULL)
goto Done;
@@ -1421,8 +1421,8 @@ odict_repr(PyODictObject *self)
Py_SIZE(pieces) = count;
}
else {
- PyObject *items = _PyObject_CallMethodIdObjArgs((PyObject *)self,
- &PyId_items, NULL);
+ PyObject *items = _PyObject_CallMethodIdNoArgs((PyObject *)self,
+ &PyId_items);
if (items == NULL)
goto Done;
pieces = PySequence_List(items);
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 3b9a537..96021ee 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -4425,7 +4425,7 @@ _PyObject_GetItemsIter(PyObject *obj, PyObject **listitems,
PyObject *items;
_Py_IDENTIFIER(items);
- items = _PyObject_CallMethodIdObjArgs(obj, &PyId_items, NULL);
+ items = _PyObject_CallMethodIdNoArgs(obj, &PyId_items);
if (items == NULL) {
Py_CLEAR(*listitems);
return -1;
diff --git a/Objects/weakrefobject.c b/Objects/weakrefobject.c
index ae3f6dc..e8a429a 100644
--- a/Objects/weakrefobject.c
+++ b/Objects/weakrefobject.c
@@ -455,7 +455,7 @@ proxy_checkref(PyWeakReference *proxy)
method(PyObject *proxy, PyObject *Py_UNUSED(ignored)) { \
_Py_IDENTIFIER(special); \
UNWRAP(proxy); \
- return _PyObject_CallMethodId(proxy, &PyId_##special, NULL); \
+ return _PyObject_CallMethodIdNoArgs(proxy, &PyId_##special); \
}