mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Use _PyObject_CallNoArg()
Replace: PyObject_CallFunctionObjArgs(callable, NULL) with: _PyObject_CallNoArg(callable)
This commit is contained in:
parent
a5ed5f000a
commit
f17c3de263
15 changed files with 21 additions and 21 deletions
|
@ -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)) {
|
||||
|
|
|
@ -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;
|
||||
|
@ -2569,7 +2569,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;
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue