mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
gh-99300: Replace Py_INCREF() with Py_NewRef() (#99513)
Replace Py_INCREF() and Py_XINCREF() using a cast with Py_NewRef() and Py_XNewRef().
This commit is contained in:
parent
ea88d34de2
commit
3ed8803ef5
12 changed files with 22 additions and 44 deletions
|
|
@ -137,11 +137,9 @@ get_timezone_utc_capi(PyObject *self, PyObject *args)
|
|||
return NULL;
|
||||
}
|
||||
if (macro) {
|
||||
Py_INCREF(PyDateTime_TimeZone_UTC);
|
||||
return PyDateTime_TimeZone_UTC;
|
||||
return Py_NewRef(PyDateTime_TimeZone_UTC);
|
||||
}
|
||||
Py_INCREF(PyDateTimeAPI->TimeZone_UTC);
|
||||
return PyDateTimeAPI->TimeZone_UTC;
|
||||
return Py_NewRef(PyDateTimeAPI->TimeZone_UTC);
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue