mirror of https://github.com/fail2ban/fail2ban
Merge branch '0.10' into 0.11
commit
2179db3692
|
@ -67,8 +67,13 @@ class JailThread(Thread):
|
||||||
def run_with_except_hook(*args, **kwargs):
|
def run_with_except_hook(*args, **kwargs):
|
||||||
try:
|
try:
|
||||||
run(*args, **kwargs)
|
run(*args, **kwargs)
|
||||||
except:
|
except Exception as e:
|
||||||
excepthook(*sys.exc_info())
|
# avoid very sporadic error "'NoneType' object has no attribute 'exc_info'" (https://bugs.python.org/issue7336)
|
||||||
|
# only extremely fast systems are affected ATM (2.7 / 3.x), if thread ends nothing is available here.
|
||||||
|
if sys is not None:
|
||||||
|
excepthook(*sys.exc_info())
|
||||||
|
else:
|
||||||
|
print(e)
|
||||||
self.run = run_with_except_hook
|
self.run = run_with_except_hook
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
|
|
Loading…
Reference in New Issue