From 9d5f20aab265f7133bd87c5d859bdfc8531d558d Mon Sep 17 00:00:00 2001 From: sebres Date: Fri, 19 Jan 2018 12:32:24 +0100 Subject: [PATCH] FilterPyinotify: fixed sporadic test-case error (multi-threaded) - 'NoneType' object has no attribute 'stop'. --- fail2ban/server/filterpyinotify.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fail2ban/server/filterpyinotify.py b/fail2ban/server/filterpyinotify.py index 17d387a1..4f3262b6 100644 --- a/fail2ban/server/filterpyinotify.py +++ b/fail2ban/server/filterpyinotify.py @@ -374,8 +374,11 @@ class FilterPyinotify(FileFilter): def stop(self): # stop filter thread: super(FilterPyinotify, self).stop() - if self.__notifier: # stop the notifier - self.__notifier.stop() + try: + if self.__notifier: # stop the notifier + self.__notifier.stop() + except AttributeError: # pragma: no cover + if self.__notifier: raise ## # Wait for exit with cleanup.