From a49d68c0dbd65a7a47c9e11feaa9e5f078000dee Mon Sep 17 00:00:00 2001 From: Safihre Date: Wed, 9 Aug 2017 22:56:07 +0200 Subject: [PATCH] Double check that we have pynotify version we can work with Closes #992 --- sabnzbd/notifier.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sabnzbd/notifier.py b/sabnzbd/notifier.py index 03d6539..8c71608 100644 --- a/sabnzbd/notifier.py +++ b/sabnzbd/notifier.py @@ -42,12 +42,14 @@ from sabnzbd.newsunpack import external_script from gntp.core import GNTPRegister from gntp.notifier import GrowlNotifier import gntp.errors + try: import Growl # Detect classic Growl (older than 1.3) _HAVE_CLASSIC_GROWL = os.path.isfile('/Library/PreferencePanes/Growl.prefPane/Contents/MacOS/Growl') except ImportError: _HAVE_CLASSIC_GROWL = False + try: import warnings # Make any warnings exceptions, so that pynotify is ignored @@ -56,6 +58,10 @@ try: warnings.simplefilter("error") import pynotify _HAVE_NTFOSD = True + + # Check for working version, not all pynotify are the same + if not hasattr(pynotify, 'init'): + _HAVE_NTFOSD = False except: _HAVE_NTFOSD = False