mirror of https://github.com/fail2ban/fail2ban
ENH: now we know that logging handlers closing was still buggy in 2.6.2
parent
571ff33fde
commit
21474884e0
|
@ -377,10 +377,11 @@ class Server:
|
||||||
handler.flush()
|
handler.flush()
|
||||||
handler.close()
|
handler.close()
|
||||||
except (ValueError, KeyError): # pragma: no cover
|
except (ValueError, KeyError): # pragma: no cover
|
||||||
if sys.version_info >= (2,6):
|
# Is known to be thrown after logging was shutdown once
|
||||||
raise
|
|
||||||
# is known to be thrown after logging was shutdown once
|
|
||||||
# with older Pythons -- seems to be safe to ignore there
|
# with older Pythons -- seems to be safe to ignore there
|
||||||
|
# At least it was still failing on 2.6.2-0ubuntu1 (jaunty)
|
||||||
|
if sys.version_info >= (2,6,3):
|
||||||
|
raise
|
||||||
# tell the handler to use this format
|
# tell the handler to use this format
|
||||||
hdlr.setFormatter(formatter)
|
hdlr.setFormatter(formatter)
|
||||||
logging.getLogger("fail2ban").addHandler(hdlr)
|
logging.getLogger("fail2ban").addHandler(hdlr)
|
||||||
|
|
Loading…
Reference in New Issue