Skip to content

Commit c916872

Browse files
committed
Remove logic to check the openlog status while calling syslog.syslog
1 parent d6955d7 commit c916872

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

Modules/syslogmodule.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -203,14 +203,11 @@ syslog_syslog_impl(PyObject *module, int group_left_1, int priority,
203203
}
204204

205205
_syslog_state *state = get_syslog_state(module);
206-
/* if log is not opened, open it now */
207-
if (!state->S_log_open) {
208-
PyObject *openlog_ret = syslog_openlog_impl(module, NULL, 0, LOG_USER);
209-
if (openlog_ret == NULL) {
210-
return NULL;
211-
}
212-
Py_DECREF(openlog_ret);
206+
PyObject *openlog_ret = syslog_openlog_impl(module, NULL, 0, LOG_USER);
207+
if (openlog_ret == NULL) {
208+
return NULL;
213209
}
210+
Py_DECREF(openlog_ret);
214211

215212
/* Incref ident, because it can be decrefed if syslog.openlog() is
216213
* called when the GIL is released.

0 commit comments

Comments
 (0)