mirror of
https://github.com/python/cpython.git
synced 2025-10-21 22:22:48 +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
|
@ -241,7 +241,7 @@ _Py_COMP_DIAG_IGNORE_DEPR_DECLS
|
|||
#define FROM_STRING(STR) \
|
||||
((STR != NULL) ? \
|
||||
PyUnicode_FromString(STR) \
|
||||
: (Py_INCREF(Py_None), Py_None))
|
||||
: Py_NewRef(Py_None))
|
||||
#define SET_ITEM_STR(VAR) \
|
||||
SET_ITEM(#VAR, FROM_STRING(VAR))
|
||||
|
||||
|
@ -1054,7 +1054,7 @@ _PyConfig_AsDict(const PyConfig *config)
|
|||
#define FROM_WSTRING(STR) \
|
||||
((STR != NULL) ? \
|
||||
PyUnicode_FromWideChar(STR, -1) \
|
||||
: (Py_INCREF(Py_None), Py_None))
|
||||
: Py_NewRef(Py_None))
|
||||
#define SET_ITEM_WSTR(ATTR) \
|
||||
SET_ITEM(#ATTR, FROM_WSTRING(config->ATTR))
|
||||
#define SET_ITEM_WSTRLIST(LIST) \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue