Skip to content

Commit d6955d7

Browse files
committed
Address code review
1 parent 6ebf768 commit d6955d7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Modules/syslogmodule.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,8 +409,11 @@ static int
409409
_syslog_clear(PyObject *module)
410410
{
411411
_syslog_state *state = get_syslog_state(module);
412-
Py_CLEAR(state->S_ident_o);
413-
state->S_log_open = 0;
412+
if (state->S_log_open) {
413+
closelog();
414+
Py_CLEAR(state->S_ident_o);
415+
state->S_log_open = 0;
416+
}
414417
return 0;
415418
}
416419

0 commit comments

Comments
 (0)