diff options
| author | Victor Stinner <vstinner@python.org> | 2022-11-10 09:03:39 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-10 09:03:39 +0100 |
| commit | d8f239d86eb70c31aa4c4ac46a1d0a27bdb14b20 (patch) | |
| tree | 7055b2d966bf41e636751177cea0248b56072e92 /Python/modsupport.c | |
| parent | f883b7f8ee3209b52863fc662343c8cd81abdc59 (diff) | |
| download | cpython-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/modsupport.c')
| -rw-r--r-- | Python/modsupport.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Python/modsupport.c b/Python/modsupport.c index 8655daa1fc..ee4bf14e63 100644 --- a/Python/modsupport.c +++ b/Python/modsupport.c @@ -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) { |
