From: Markus Lehtonen Date: Thu, 12 Jun 2014 09:04:09 +0000 (+0300) Subject: notify: catch RuntimeError when importing pynotify X-Git-Tag: debian/0.6.23~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f48f0ff3fdf636f9e11d0be9c558a1341e7cd5fa;p=tools%2Fgit-buildpackage.git notify: catch RuntimeError when importing pynotify Work around a problem in some distros (e.g. Fedora) where "import pynotify" crashes in RuntimeError in some cases, e.g. when DISPLAY env variable is not set. Signed-off-by: Markus Lehtonen --- diff --git a/gbp/notifications.py b/gbp/notifications.py index 95c4bf41..9d9071a9 100644 --- a/gbp/notifications.py +++ b/gbp/notifications.py @@ -28,7 +28,7 @@ def enable_notifications(): try: import pynotify notify_module = pynotify - except ImportError: + except (ImportError, RuntimeError): return False return notify_module.init("git-buildpackage")