From 075beda4e48a855764c0367efa8a625a063a3735 Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Thu, 12 Jun 2014 12:04:09 +0300 Subject: [PATCH] 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 --- gbp/notifications.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gbp/notifications.py b/gbp/notifications.py index 95c4bf4..9d9071a 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") -- 2.7.4