mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
gh-99300: Use Py_NewRef() in Python/ directory (#99302)
Replace Py_INCREF() and Py_XINCREF() with Py_NewRef() and Py_XNewRef() in C files of the Python/ directory.
This commit is contained in:
parent
f883b7f8ee
commit
d8f239d86e
14 changed files with 41 additions and 80 deletions
|
@ -359,8 +359,7 @@ do_mkvalue(const char **p_format, va_list *p_va, int flags)
|
|||
else
|
||||
n = -1;
|
||||
if (u == NULL) {
|
||||
v = Py_None;
|
||||
Py_INCREF(v);
|
||||
v = Py_NewRef(Py_None);
|
||||
}
|
||||
else {
|
||||
if (n < 0)
|
||||
|
@ -410,8 +409,7 @@ do_mkvalue(const char **p_format, va_list *p_va, int flags)
|
|||
else
|
||||
n = -1;
|
||||
if (str == NULL) {
|
||||
v = Py_None;
|
||||
Py_INCREF(v);
|
||||
v = Py_NewRef(Py_None);
|
||||
}
|
||||
else {
|
||||
if (n < 0) {
|
||||
|
@ -446,8 +444,7 @@ do_mkvalue(const char **p_format, va_list *p_va, int flags)
|
|||
else
|
||||
n = -1;
|
||||
if (str == NULL) {
|
||||
v = Py_None;
|
||||
Py_INCREF(v);
|
||||
v = Py_NewRef(Py_None);
|
||||
}
|
||||
else {
|
||||
if (n < 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue