summaryrefslogtreecommitdiff
path: root/Python/initconfig.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-11-10 09:03:39 +0100
committerGitHub <noreply@github.com>2022-11-10 09:03:39 +0100
commitd8f239d86eb70c31aa4c4ac46a1d0a27bdb14b20 (patch)
tree7055b2d966bf41e636751177cea0248b56072e92 /Python/initconfig.c
parentf883b7f8ee3209b52863fc662343c8cd81abdc59 (diff)
downloadcpython-git-d8f239d86eb70c31aa4c4ac46a1d0a27bdb14b20.tar.gz
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.
Diffstat (limited to 'Python/initconfig.c')
-rw-r--r--Python/initconfig.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/initconfig.c b/Python/initconfig.c
index 4b784290b0..67f6777d3b 100644
--- a/Python/initconfig.c
+++ b/Python/initconfig.c
@@ -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) \