Move strptime workaround to fail2ban/__init__.py

pull/906/head
Lee Clemens 10 years ago
parent d0bcacd97b
commit b26725f654

@ -430,9 +430,6 @@ class ServerExecutionException(Exception):
pass
if __name__ == "__main__": # pragma: no cover - can't test main
from time import strptime
# strptime thread safety hack-around - http://bugs.python.org/issue7980
strptime("2012", "%Y")
client = Fail2banClient()
# Exit with correct return value
if client.start(sys.argv):

@ -474,9 +474,6 @@ class Fail2banRegex(object):
if __name__ == "__main__":
from time import strptime
# strptime thread safety hack-around - http://bugs.python.org/issue7980
strptime("2012", "%Y")
parser = get_opt_parser()
(opts, args) = parser.parse_args()

@ -131,9 +131,6 @@ class Fail2banServer:
return False
if __name__ == "__main__":
from time import strptime
# strptime thread safety hack-around - http://bugs.python.org/issue7980
strptime("2012", "%Y")
server = Fail2banServer()
if server.start(sys.argv):
sys.exit(0)

@ -68,3 +68,7 @@ logging.notice = _root_notice
# add NOTICE to the priority map of all the levels
logging.handlers.SysLogHandler.priority_map['NOTICE'] = 'notice'
from time import strptime
# strptime thread safety hack-around - http://bugs.python.org/issue7980
strptime("2012", "%Y")

Loading…
Cancel
Save