FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-37493: use _PyObject_CallNoArg in more places by jdemeyer · Pull Request #14575 · python/cpython · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .c  (5) .rst  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
2 changes: 1 addition & 1 deletion Doc/extending/newtypes.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ done. This can be done using the :c:func:`PyErr_Fetch` and
/* This saves the current exception state */
PyErr_Fetch(&err_type, &err_value, &err_traceback);

cbresult = PyObject_CallObject(self->my_callback, NULL);
cbresult = PyObject_CallNoArgs(self->my_callback);
if (cbresult == NULL)
PyErr_WriteUnraisable(self->my_callback);
else
Expand Down
2 changes: 1 addition & 1 deletion Modules/_collectionsmodule.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1977,7 +1977,7 @@ defdict_missing(defdictobject *dd, PyObject *key)
Py_DECREF(tup);
return NULL;
}
value = PyEval_CallObject(factory, NULL);
value = _PyObject_CallNoArg(factory);
if (value == NULL)
return value;
if (PyObject_SetItem((PyObject *)dd, key, value) < 0) {
Expand Down
20 changes: 10 additions & 10 deletions Modules/_ctypes/_ctypes.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1001,8 +1001,8 @@ PyCPointerType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
stgdict items size, align, length contain info about pointers itself,
stgdict->proto has info about the pointed to type!
*/
stgdict = (StgDictObject *)PyObject_CallObject(
(PyObject *)&PyCStgDict_Type, NULL);
stgdict = (StgDictObject *)_PyObject_CallNoArg(
(PyObject *)&PyCStgDict_Type);
if (!stgdict)
return NULL;
stgdict->size = sizeof(void *);
Expand Down Expand Up @@ -1489,8 +1489,8 @@ PyCArrayType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
goto error;
}

stgdict = (StgDictObject *)PyObject_CallObject(
(PyObject *)&PyCStgDict_Type, NULL);
stgdict = (StgDictObject *)_PyObject_CallNoArg(
(PyObject *)&PyCStgDict_Type);
if (!stgdict)
goto error;

Expand Down Expand Up @@ -1946,8 +1946,8 @@ static PyObject *CreateSwappedType(PyTypeObject *type, PyObject *args, PyObject
if (result == NULL)
return NULL;

stgdict = (StgDictObject *)PyObject_CallObject(
(PyObject *)&PyCStgDict_Type, NULL);
stgdict = (StgDictObject *)_PyObject_CallNoArg(
(PyObject *)&PyCStgDict_Type);
if (!stgdict) {
Py_DECREF(result);
return NULL;
Expand Down Expand Up @@ -2060,8 +2060,8 @@ PyCSimpleType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
goto error;
}

stgdict = (StgDictObject *)PyObject_CallObject(
(PyObject *)&PyCStgDict_Type, NULL);
stgdict = (StgDictObject *)_PyObject_CallNoArg(
(PyObject *)&PyCStgDict_Type);
if (!stgdict)
goto error;

Expand Down Expand Up @@ -2454,8 +2454,8 @@ PyCFuncPtrType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
PyTypeObject *result;
StgDictObject *stgdict;

stgdict = (StgDictObject *)PyObject_CallObject(
(PyObject *)&PyCStgDict_Type, NULL);
stgdict = (StgDictObject *)_PyObject_CallNoArg(
(PyObject *)&PyCStgDict_Type);
if (!stgdict)
return NULL;

Expand Down
3 changes: 1 addition & 2 deletions Modules/_ctypes/cfield.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ PyCField_FromDesc(PyObject *desc, Py_ssize_t index,
#define CONT_BITFIELD 2
#define EXPAND_BITFIELD 3

self = (CFieldObject *)PyObject_CallObject((PyObject *)&PyCField_Type,
NULL);
self = (CFieldObject *)_PyObject_CallNoArg((PyObject *)&PyCField_Type);
if (self == NULL)
return NULL;
dict = PyType_stgdict(desc);
Expand Down
2 changes: 1 addition & 1 deletion Modules/_testcapimodule.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -4907,7 +4907,7 @@ bad_get(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
return NULL;
}

PyObject *res = PyObject_CallObject(cls, NULL);
PyObject *res = _PyObject_CallNoArg(cls);
if (res == NULL) {
return NULL;
}
Expand Down
2 changes: 1 addition & 1 deletion Modules/posixmodule.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ run_at_forkers(PyObject *lst, int reverse)
for (i = 0; i < PyList_GET_SIZE(cpy); i++) {
PyObject *func, *res;
func = PyList_GET_ITEM(cpy, i);
res = PyObject_CallObject(func, NULL);
res = _PyObject_CallNoArg(func);
if (res == NULL)
PyErr_WriteUnraisable(func);
else
Expand Down

Back | FazBrowse Home | New Git URL