summaryrefslogtreecommitdiff
path: root/Modules/syslogmodule.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-11-16 10:39:47 +0100
committerGitHub <noreply@github.com>2022-11-16 10:39:47 +0100
commit3ed8803ef59f80e03c40b100b04c2e13f138ceed (patch)
treeec9ce18edd242485d4e3198d8e62924e1616c4ea /Modules/syslogmodule.c
parentea88d34de27ba2b3acaeb03c7dc7829dff40ea5c (diff)
downloadcpython-git-3ed8803ef59f80e03c40b100b04c2e13f138ceed.tar.gz
gh-99300: Replace Py_INCREF() with Py_NewRef() (#99513)
Replace Py_INCREF() and Py_XINCREF() using a cast with Py_NewRef() and Py_XNewRef().
Diffstat (limited to 'Modules/syslogmodule.c')
-rw-r--r--Modules/syslogmodule.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Modules/syslogmodule.c b/Modules/syslogmodule.c
index 5137d01c68..23833b7285 100644
--- a/Modules/syslogmodule.c
+++ b/Modules/syslogmodule.c
@@ -205,8 +205,7 @@ syslog_syslog_impl(PyObject *module, int group_left_1, int priority,
/* Incref ident, because it can be decrefed if syslog.openlog() is
* called when the GIL is released.
*/
- PyObject *ident = S_ident_o;
- Py_XINCREF(ident);
+ PyObject *ident = Py_XNewRef(S_ident_o);
#ifdef __APPLE__
// gh-98178: On macOS, libc syslog() is not thread-safe
syslog(priority, "%s", message);