summaryrefslogtreecommitdiff
path: root/Objects
diff options
context:
space:
mode:
Diffstat (limited to 'Objects')
-rw-r--r--Objects/abstract.c8
-rw-r--r--Objects/bytearrayobject.c6
-rw-r--r--Objects/bytesobject.c7
-rw-r--r--Objects/complexobject.c2
-rw-r--r--Objects/descrobject.c2
-rw-r--r--Objects/dictobject.c3
-rw-r--r--Objects/enumobject.c2
-rw-r--r--Objects/floatobject.c2
-rw-r--r--Objects/genobject.c4
-rw-r--r--Objects/listobject.c3
-rw-r--r--Objects/longobject.c3
-rw-r--r--Objects/memoryobject.c4
-rw-r--r--Objects/object.c4
-rw-r--r--Objects/odictobject.c2
-rw-r--r--Objects/typeobject.c6
-rw-r--r--Objects/unicodeobject.c10
-rw-r--r--Objects/weakrefobject.c2
17 files changed, 30 insertions, 40 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c
index beb12c98f6..2f238ed0f1 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -103,7 +103,7 @@ PyObject_LengthHint(PyObject *o, Py_ssize_t defaultvalue)
}
return defaultvalue;
}
- result = PyObject_CallFunctionObjArgs(hint, NULL);
+ result = _PyObject_CallNoArg(hint);
Py_DECREF(hint);
if (result == NULL) {
if (PyErr_ExceptionMatches(PyExc_TypeError)) {
@@ -716,7 +716,7 @@ PyObject_Format(PyObject *obj, PyObject *format_spec)
}
/* And call it. */
- result = PyObject_CallFunctionObjArgs(meth, format_spec, NULL);
+ result = _PyObject_CallArg1(meth, format_spec);
Py_DECREF(meth);
if (result && !PyUnicode_Check(result)) {
@@ -3011,7 +3011,7 @@ PyObject_IsInstance(PyObject *inst, PyObject *cls)
Py_DECREF(checker);
return ok;
}
- res = PyObject_CallFunctionObjArgs(checker, inst, NULL);
+ res = _PyObject_CallArg1(checker, inst);
Py_LeaveRecursiveCall();
Py_DECREF(checker);
if (res != NULL) {
@@ -3085,7 +3085,7 @@ PyObject_IsSubclass(PyObject *derived, PyObject *cls)
Py_DECREF(checker);
return ok;
}
- res = PyObject_CallFunctionObjArgs(checker, derived, NULL);
+ res = _PyObject_CallArg1(checker, derived);
Py_LeaveRecursiveCall();
Py_DECREF(checker);
if (res != NULL) {
diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c
index 16b4fd7a90..853156eabc 100644
--- a/Objects/bytearrayobject.c
+++ b/Objects/bytearrayobject.c
@@ -98,8 +98,7 @@ _canresize(PyByteArrayObject *self)
PyObject *
PyByteArray_FromObject(PyObject *input)
{
- return PyObject_CallFunctionObjArgs((PyObject *)&PyByteArray_Type,
- input, NULL);
+ return _PyObject_CallArg1((PyObject *)&PyByteArray_Type, input);
}
PyObject *
@@ -1985,8 +1984,7 @@ bytearray_fromhex_impl(PyTypeObject *type, PyObject *string)
{
PyObject *result = _PyBytes_FromHex(string, type == &PyByteArray_Type);
if (type != &PyByteArray_Type && result != NULL) {
- Py_SETREF(result, PyObject_CallFunctionObjArgs((PyObject *)type,
- result, NULL));
+ Py_SETREF(result, _PyObject_CallArg1((PyObject *)type, result));
}
return result;
}
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
index 5cdc2ca30e..b82945ab1d 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -549,7 +549,7 @@ format_obj(PyObject *v, const char **pbuf, Py_ssize_t *plen)
/* does it support __bytes__? */
func = _PyObject_LookupSpecial(v, &PyId___bytes__);
if (func != NULL) {
- result = PyObject_CallFunctionObjArgs(func, NULL);
+ result = _PyObject_CallNoArg(func);
Py_DECREF(func);
if (result == NULL)
return NULL;
@@ -2331,8 +2331,7 @@ bytes_fromhex_impl(PyTypeObject *type, PyObject *string)
{
PyObject *result = _PyBytes_FromHex(string, 0);
if (type != &PyBytes_Type && result != NULL) {
- Py_SETREF(result, PyObject_CallFunctionObjArgs((PyObject *)type,
- result, NULL));
+ Py_SETREF(result, _PyObject_CallArg1((PyObject *)type, result));
}
return result;
}
@@ -2569,7 +2568,7 @@ bytes_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
PyObject_Bytes doesn't do. */
func = _PyObject_LookupSpecial(x, &PyId___bytes__);
if (func != NULL) {
- new = PyObject_CallFunctionObjArgs(func, NULL);
+ new = _PyObject_CallNoArg(func);
Py_DECREF(func);
if (new == NULL)
return NULL;
diff --git a/Objects/complexobject.c b/Objects/complexobject.c
index 31e12784cc..0d391e5208 100644
--- a/Objects/complexobject.c
+++ b/Objects/complexobject.c
@@ -273,7 +273,7 @@ try_complex_special_method(PyObject *op) {
f = _PyObject_LookupSpecial(op, &PyId___complex__);
if (f) {
- PyObject *res = PyObject_CallFunctionObjArgs(f, NULL);
+ PyObject *res = _PyObject_CallNoArg(f);
Py_DECREF(f);
if (res != NULL && !PyComplex_Check(res)) {
PyErr_SetString(PyExc_TypeError,
diff --git a/Objects/descrobject.c b/Objects/descrobject.c
index 076e741481..82cc181029 100644
--- a/Objects/descrobject.c
+++ b/Objects/descrobject.c
@@ -1414,7 +1414,7 @@ property_descr_set(PyObject *self, PyObject *obj, PyObject *value)
return -1;
}
if (value == NULL)
- res = PyObject_CallFunctionObjArgs(func, obj, NULL);
+ res = _PyObject_CallArg1(func, obj);
else
res = PyObject_CallFunctionObjArgs(func, obj, value, NULL);
if (res == NULL)
diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index 2a01f70b71..b74941ac29 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -2066,8 +2066,7 @@ dict_subscript(PyDictObject *mp, PyObject *key)
_Py_IDENTIFIER(__missing__);
missing = _PyObject_LookupSpecial((PyObject *)mp, &PyId___missing__);
if (missing != NULL) {
- res = PyObject_CallFunctionObjArgs(missing,
- key, NULL);
+ res = _PyObject_CallArg1(missing, key);
Py_DECREF(missing);
return res;
}
diff --git a/Objects/enumobject.c b/Objects/enumobject.c
index dae166d5ad..72d31b16af 100644
--- a/Objects/enumobject.c
+++ b/Objects/enumobject.c
@@ -258,7 +258,7 @@ reversed_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
return NULL;
}
if (reversed_meth != NULL) {
- PyObject *res = PyObject_CallFunctionObjArgs(reversed_meth, NULL);
+ PyObject *res = _PyObject_CallNoArg(reversed_meth);
Py_DECREF(reversed_meth);
return res;
}
diff --git a/Objects/floatobject.c b/Objects/floatobject.c
index 17a55dd114..997d1f9665 100644
--- a/Objects/floatobject.c
+++ b/Objects/floatobject.c
@@ -1439,7 +1439,7 @@ float_fromhex(PyObject *cls, PyObject *arg)
goto parse_error;
result = PyFloat_FromDouble(negate ? -x : x);
if (cls != (PyObject *)&PyFloat_Type && result != NULL) {
- Py_SETREF(result, PyObject_CallFunctionObjArgs(cls, result, NULL));
+ Py_SETREF(result, _PyObject_CallArg1(cls, result));
}
return result;
diff --git a/Objects/genobject.c b/Objects/genobject.c
index 2680ab0e12..1db83c9d64 100644
--- a/Objects/genobject.c
+++ b/Objects/genobject.c
@@ -43,7 +43,7 @@ _PyGen_Finalize(PyObject *self)
/* Save the current exception, if any. */
PyErr_Fetch(&error_type, &error_value, &error_traceback);
- res = PyObject_CallFunctionObjArgs(finalizer, self, NULL);
+ res = _PyObject_CallArg1(finalizer, self);
if (res == NULL) {
PyErr_WriteUnraisable(self);
@@ -591,7 +591,7 @@ _PyGen_SetStopIterationValue(PyObject *value)
*
* (See PyErr_SetObject/_PyErr_CreateException code for details.)
*/
- e = PyObject_CallFunctionObjArgs(PyExc_StopIteration, value, NULL);
+ e = _PyObject_CallArg1(PyExc_StopIteration, value);
if (e == NULL) {
return -1;
}
diff --git a/Objects/listobject.c b/Objects/listobject.c
index dcd7b5efe5..81b6c48557 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -1970,8 +1970,7 @@ listsort(PyListObject *self, PyObject *args, PyObject *kwds)
}
for (i = 0; i < saved_ob_size ; i++) {
- keys[i] = PyObject_CallFunctionObjArgs(keyfunc, saved_ob_item[i],
- NULL);
+ keys[i] = _PyObject_CallArg1(keyfunc, saved_ob_item[i]);
if (keys[i] == NULL) {
for (i=i-1 ; i>=0 ; i--)
Py_DECREF(keys[i]);
diff --git a/Objects/longobject.c b/Objects/longobject.c
index c95f9467ad..b9f6327759 100644
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -5282,8 +5282,7 @@ long_from_bytes(PyTypeObject *type, PyObject *args, PyObject *kwds)
Py_DECREF(bytes);
if (type != &PyLong_Type) {
- Py_SETREF(long_obj, PyObject_CallFunctionObjArgs((PyObject *)type,
- long_obj, NULL));
+ Py_SETREF(long_obj, _PyObject_CallArg1((PyObject *)type, long_obj));
}
return long_obj;
diff --git a/Objects/memoryobject.c b/Objects/memoryobject.c
index 428d83c987..eac07fbc03 100644
--- a/Objects/memoryobject.c
+++ b/Objects/memoryobject.c
@@ -1939,7 +1939,7 @@ struct_get_unpacker(const char *fmt, Py_ssize_t itemsize)
if (format == NULL)
goto error;
- structobj = PyObject_CallFunctionObjArgs(Struct, format, NULL);
+ structobj = _PyObject_CallArg1(Struct, format);
if (structobj == NULL)
goto error;
@@ -1978,7 +1978,7 @@ struct_unpack_single(const char *ptr, struct unpacker *x)
PyObject *v;
memcpy(x->item, ptr, x->itemsize);
- v = PyObject_CallFunctionObjArgs(x->unpack_from, x->mview, NULL);
+ v = _PyObject_CallArg1(x->unpack_from, x->mview);
if (v == NULL)
return NULL;
diff --git a/Objects/object.c b/Objects/object.c
index d88ae3b94f..4844bd7669 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -596,7 +596,7 @@ PyObject_Bytes(PyObject *v)
func = _PyObject_LookupSpecial(v, &PyId___bytes__);
if (func != NULL) {
- result = PyObject_CallFunctionObjArgs(func, NULL);
+ result = _PyObject_CallNoArg(func);
Py_DECREF(func);
if (result == NULL)
return NULL;
@@ -1314,7 +1314,7 @@ _dir_object(PyObject *obj)
return NULL;
}
/* use __dir__ */
- result = PyObject_CallFunctionObjArgs(dirfunc, NULL);
+ result = _PyObject_CallNoArg(dirfunc);
Py_DECREF(dirfunc);
if (result == NULL)
return NULL;
diff --git a/Objects/odictobject.c b/Objects/odictobject.c
index 22b1f1dfed..77fb3a181d 100644
--- a/Objects/odictobject.c
+++ b/Objects/odictobject.c
@@ -1256,7 +1256,7 @@ odict_copy(register PyODictObject *od)
if (PyODict_CheckExact(od))
od_copy = PyODict_New();
else
- od_copy = PyObject_CallFunctionObjArgs((PyObject *)Py_TYPE(od), NULL);
+ od_copy = _PyObject_CallNoArg((PyObject *)Py_TYPE(od));
if (od_copy == NULL)
return NULL;
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 186c57016c..a9f352046c 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -3487,9 +3487,7 @@ object_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
sorted = _PyDict_GetItemId(builtins, &PyId_sorted);
if (sorted == NULL)
goto error;
- sorted_methods = PyObject_CallFunctionObjArgs(sorted,
- abstract_methods,
- NULL);
+ sorted_methods = _PyObject_CallArg1(sorted, abstract_methods);
if (sorted_methods == NULL)
goto error;
comma = _PyUnicode_FromId(&comma_id);
@@ -6193,7 +6191,7 @@ call_attribute(PyObject *self, PyObject *attr, PyObject *name)
else
attr = descr;
}
- res = PyObject_CallFunctionObjArgs(attr, name, NULL);
+ res = _PyObject_CallArg1(attr, name);
Py_XDECREF(descr);
return res;
}
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 1c2257e141..8f6f6c675f 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -4269,7 +4269,7 @@ unicode_decode_call_errorhandler_wchar(
if (*exceptionObject == NULL)
goto onError;
- restuple = PyObject_CallFunctionObjArgs(*errorHandler, *exceptionObject, NULL);
+ restuple = _PyObject_CallArg1(*errorHandler, *exceptionObject);
if (restuple == NULL)
goto onError;
if (!PyTuple_Check(restuple)) {
@@ -4368,7 +4368,7 @@ unicode_decode_call_errorhandler_writer(
if (*exceptionObject == NULL)
goto onError;
- restuple = PyObject_CallFunctionObjArgs(*errorHandler, *exceptionObject, NULL);
+ restuple = _PyObject_CallArg1(*errorHandler, *exceptionObject);
if (restuple == NULL)
goto onError;
if (!PyTuple_Check(restuple)) {
@@ -6649,8 +6649,7 @@ unicode_encode_call_errorhandler(const char *errors,
if (*exceptionObject == NULL)
return NULL;
- restuple = PyObject_CallFunctionObjArgs(
- *errorHandler, *exceptionObject, NULL);
+ restuple = _PyObject_CallArg1(*errorHandler, *exceptionObject);
if (restuple == NULL)
return NULL;
if (!PyTuple_Check(restuple)) {
@@ -8644,8 +8643,7 @@ unicode_translate_call_errorhandler(const char *errors,
if (*exceptionObject == NULL)
return NULL;
- restuple = PyObject_CallFunctionObjArgs(
- *errorHandler, *exceptionObject, NULL);
+ restuple = _PyObject_CallArg1(*errorHandler, *exceptionObject);
if (restuple == NULL)
return NULL;
if (!PyTuple_Check(restuple)) {
diff --git a/Objects/weakrefobject.c b/Objects/weakrefobject.c
index ab6b235255..2f33aed026 100644
--- a/Objects/weakrefobject.c
+++ b/Objects/weakrefobject.c
@@ -867,7 +867,7 @@ PyWeakref_GetObject(PyObject *ref)
static void
handle_callback(PyWeakReference *ref, PyObject *callback)
{
- PyObject *cbresult = PyObject_CallFunctionObjArgs(callback, ref, NULL);
+ PyObject *cbresult = _PyObject_CallArg1(callback, ref);
if (cbresult == NULL)
PyErr_WriteUnraisable(callback);