summaryrefslogtreecommitdiff
path: root/Modules/syslogmodule.c
diff options
context:
space:
mode:
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);