Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
7f41c8e0
Commit
7f41c8e0
authored
Jul 04, 2019
by
Jeroen Demeyer
Committed by
Inada Naoki
Jul 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-37493: use _PyObject_CallNoArg in more places (GH-14575)
parent
196a530e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
16 deletions
+15
-16
Doc/extending/newtypes.rst
Doc/extending/newtypes.rst
+1
-1
Modules/_collectionsmodule.c
Modules/_collectionsmodule.c
+1
-1
Modules/_ctypes/_ctypes.c
Modules/_ctypes/_ctypes.c
+10
-10
Modules/_ctypes/cfield.c
Modules/_ctypes/cfield.c
+1
-2
Modules/_testcapimodule.c
Modules/_testcapimodule.c
+1
-1
Modules/posixmodule.c
Modules/posixmodule.c
+1
-1
No files found.
Doc/extending/newtypes.rst
View file @
7f41c8e0
...
@@ -104,7 +104,7 @@ done. This can be done using the :c:func:`PyErr_Fetch` and
...
@@ -104,7 +104,7 @@ done. This can be done using the :c:func:`PyErr_Fetch` and
/* This saves the current exception state */
/* This saves the current exception state */
PyErr_Fetch(&err_type, &err_value, &err_traceback);
PyErr_Fetch(&err_type, &err_value, &err_traceback);
cbresult = PyObject_Call
Object(self->my_callback, NULL
);
cbresult = PyObject_Call
NoArgs(self->my_callback
);
if (cbresult == NULL)
if (cbresult == NULL)
PyErr_WriteUnraisable(self->my_callback);
PyErr_WriteUnraisable(self->my_callback);
else
else
...
...
Modules/_collectionsmodule.c
View file @
7f41c8e0
...
@@ -1976,7 +1976,7 @@ defdict_missing(defdictobject *dd, PyObject *key)
...
@@ -1976,7 +1976,7 @@ defdict_missing(defdictobject *dd, PyObject *key)
Py_DECREF
(
tup
);
Py_DECREF
(
tup
);
return
NULL
;
return
NULL
;
}
}
value
=
PyEval_CallObject
(
factory
,
NULL
);
value
=
_PyObject_CallNoArg
(
factory
);
if
(
value
==
NULL
)
if
(
value
==
NULL
)
return
value
;
return
value
;
if
(
PyObject_SetItem
((
PyObject
*
)
dd
,
key
,
value
)
<
0
)
{
if
(
PyObject_SetItem
((
PyObject
*
)
dd
,
key
,
value
)
<
0
)
{
...
...
Modules/_ctypes/_ctypes.c
View file @
7f41c8e0
...
@@ -1001,8 +1001,8 @@ PyCPointerType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
...
@@ -1001,8 +1001,8 @@ PyCPointerType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
stgdict items size, align, length contain info about pointers itself,
stgdict items size, align, length contain info about pointers itself,
stgdict->proto has info about the pointed to type!
stgdict->proto has info about the pointed to type!
*/
*/
stgdict
=
(
StgDictObject
*
)
PyObject_CallObject
(
stgdict
=
(
StgDictObject
*
)
_PyObject_CallNoArg
(
(
PyObject
*
)
&
PyCStgDict_Type
,
NULL
);
(
PyObject
*
)
&
PyCStgDict_Type
);
if
(
!
stgdict
)
if
(
!
stgdict
)
return
NULL
;
return
NULL
;
stgdict
->
size
=
sizeof
(
void
*
);
stgdict
->
size
=
sizeof
(
void
*
);
...
@@ -1489,8 +1489,8 @@ PyCArrayType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
...
@@ -1489,8 +1489,8 @@ PyCArrayType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
goto
error
;
goto
error
;
}
}
stgdict
=
(
StgDictObject
*
)
PyObject_CallObject
(
stgdict
=
(
StgDictObject
*
)
_PyObject_CallNoArg
(
(
PyObject
*
)
&
PyCStgDict_Type
,
NULL
);
(
PyObject
*
)
&
PyCStgDict_Type
);
if
(
!
stgdict
)
if
(
!
stgdict
)
goto
error
;
goto
error
;
...
@@ -1946,8 +1946,8 @@ static PyObject *CreateSwappedType(PyTypeObject *type, PyObject *args, PyObject
...
@@ -1946,8 +1946,8 @@ static PyObject *CreateSwappedType(PyTypeObject *type, PyObject *args, PyObject
if
(
result
==
NULL
)
if
(
result
==
NULL
)
return
NULL
;
return
NULL
;
stgdict
=
(
StgDictObject
*
)
PyObject_CallObject
(
stgdict
=
(
StgDictObject
*
)
_PyObject_CallNoArg
(
(
PyObject
*
)
&
PyCStgDict_Type
,
NULL
);
(
PyObject
*
)
&
PyCStgDict_Type
);
if
(
!
stgdict
)
{
if
(
!
stgdict
)
{
Py_DECREF
(
result
);
Py_DECREF
(
result
);
return
NULL
;
return
NULL
;
...
@@ -2060,8 +2060,8 @@ PyCSimpleType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
...
@@ -2060,8 +2060,8 @@ PyCSimpleType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
goto
error
;
goto
error
;
}
}
stgdict
=
(
StgDictObject
*
)
PyObject_CallObject
(
stgdict
=
(
StgDictObject
*
)
_PyObject_CallNoArg
(
(
PyObject
*
)
&
PyCStgDict_Type
,
NULL
);
(
PyObject
*
)
&
PyCStgDict_Type
);
if
(
!
stgdict
)
if
(
!
stgdict
)
goto
error
;
goto
error
;
...
@@ -2454,8 +2454,8 @@ PyCFuncPtrType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
...
@@ -2454,8 +2454,8 @@ PyCFuncPtrType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
PyTypeObject
*
result
;
PyTypeObject
*
result
;
StgDictObject
*
stgdict
;
StgDictObject
*
stgdict
;
stgdict
=
(
StgDictObject
*
)
PyObject_CallObject
(
stgdict
=
(
StgDictObject
*
)
_PyObject_CallNoArg
(
(
PyObject
*
)
&
PyCStgDict_Type
,
NULL
);
(
PyObject
*
)
&
PyCStgDict_Type
);
if
(
!
stgdict
)
if
(
!
stgdict
)
return
NULL
;
return
NULL
;
...
...
Modules/_ctypes/cfield.c
View file @
7f41c8e0
...
@@ -60,8 +60,7 @@ PyCField_FromDesc(PyObject *desc, Py_ssize_t index,
...
@@ -60,8 +60,7 @@ PyCField_FromDesc(PyObject *desc, Py_ssize_t index,
#define CONT_BITFIELD 2
#define CONT_BITFIELD 2
#define EXPAND_BITFIELD 3
#define EXPAND_BITFIELD 3
self
=
(
CFieldObject
*
)
PyObject_CallObject
((
PyObject
*
)
&
PyCField_Type
,
self
=
(
CFieldObject
*
)
_PyObject_CallNoArg
((
PyObject
*
)
&
PyCField_Type
);
NULL
);
if
(
self
==
NULL
)
if
(
self
==
NULL
)
return
NULL
;
return
NULL
;
dict
=
PyType_stgdict
(
desc
);
dict
=
PyType_stgdict
(
desc
);
...
...
Modules/_testcapimodule.c
View file @
7f41c8e0
...
@@ -4907,7 +4907,7 @@ bad_get(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
...
@@ -4907,7 +4907,7 @@ bad_get(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
return
NULL
;
return
NULL
;
}
}
PyObject
*
res
=
PyObject_CallObject
(
cls
,
NULL
);
PyObject
*
res
=
_PyObject_CallNoArg
(
cls
);
if
(
res
==
NULL
)
{
if
(
res
==
NULL
)
{
return
NULL
;
return
NULL
;
}
}
...
...
Modules/posixmodule.c
View file @
7f41c8e0
...
@@ -433,7 +433,7 @@ run_at_forkers(PyObject *lst, int reverse)
...
@@ -433,7 +433,7 @@ run_at_forkers(PyObject *lst, int reverse)
for
(
i
=
0
;
i
<
PyList_GET_SIZE
(
cpy
);
i
++
)
{
for
(
i
=
0
;
i
<
PyList_GET_SIZE
(
cpy
);
i
++
)
{
PyObject
*
func
,
*
res
;
PyObject
*
func
,
*
res
;
func
=
PyList_GET_ITEM
(
cpy
,
i
);
func
=
PyList_GET_ITEM
(
cpy
,
i
);
res
=
PyObject_CallObject
(
func
,
NULL
);
res
=
_PyObject_CallNoArg
(
func
);
if
(
res
==
NULL
)
if
(
res
==
NULL
)
PyErr_WriteUnraisable
(
func
);
PyErr_WriteUnraisable
(
func
);
else
else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment