mirror of
https://github.com/python/cpython.git
synced 2025-07-19 01:05:26 +00:00
bpo-39573: Finish converting to new Py_IS_TYPE() macro (GH-18601)
This commit is contained in:
parent
22a9a546ff
commit
dffe4c0709
23 changed files with 56 additions and 57 deletions
|
@ -4851,7 +4851,7 @@ trace_call_function(PyThreadState *tstate,
|
|||
C_TRACE(x, PyObject_Vectorcall(func, args, nargs, kwnames));
|
||||
return x;
|
||||
}
|
||||
else if (Py_TYPE(func) == &PyMethodDescr_Type && nargs > 0) {
|
||||
else if (Py_IS_TYPE(func, &PyMethodDescr_Type) && nargs > 0) {
|
||||
/* We need to create a temporary bound method as argument
|
||||
for profiling.
|
||||
|
||||
|
@ -4912,7 +4912,7 @@ do_call_core(PyThreadState *tstate, PyObject *func, PyObject *callargs, PyObject
|
|||
C_TRACE(result, PyObject_Call(func, callargs, kwdict));
|
||||
return result;
|
||||
}
|
||||
else if (Py_TYPE(func) == &PyMethodDescr_Type) {
|
||||
else if (Py_IS_TYPE(func, &PyMethodDescr_Type)) {
|
||||
Py_ssize_t nargs = PyTuple_GET_SIZE(callargs);
|
||||
if (nargs > 0 && tstate->use_tracing) {
|
||||
/* We need to create a temporary bound method as argument
|
||||
|
|
|
@ -573,7 +573,7 @@ PyErr_BadArgument(void)
|
|||
PyObject *
|
||||
_PyErr_NoMemory(PyThreadState *tstate)
|
||||
{
|
||||
if (Py_TYPE(PyExc_MemoryError) == NULL) {
|
||||
if (Py_IS_TYPE(PyExc_MemoryError, NULL)) {
|
||||
/* PyErr_NoMemory() has been called before PyExc_MemoryError has been
|
||||
initialized by _PyExc_Init() */
|
||||
Py_FatalError("Out of memory and PyExc_MemoryError is not "
|
||||
|
|
|
@ -181,7 +181,7 @@ _PyImport_LoadDynamicModuleWithSpec(PyObject *spec, FILE *fp)
|
|||
m = NULL;
|
||||
goto error;
|
||||
}
|
||||
if (Py_TYPE(m) == NULL) {
|
||||
if (Py_IS_TYPE(m, NULL)) {
|
||||
/* This can happen when a PyModuleDef is returned without calling
|
||||
* PyModuleDef_Init on it
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue