From 3ed8803ef59f80e03c40b100b04c2e13f138ceed Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 16 Nov 2022 10:39:47 +0100 Subject: gh-99300: Replace Py_INCREF() with Py_NewRef() (#99513) Replace Py_INCREF() and Py_XINCREF() using a cast with Py_NewRef() and Py_XNewRef(). --- Modules/syslogmodule.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Modules/syslogmodule.c') 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); -- cgit v1.2.1