aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2014-06-12 12:04:09 +0300
committerGuido G√ľnther <agx@sigxcpu.org>2014-12-05 15:52:19 +0100
commitf48f0ff3fdf636f9e11d0be9c558a1341e7cd5fa (patch)
tree2a859543125e25e3be89ad2f120dfc07dc504051
parent01470e125483d48d3257148ef96f73ad8ed43469 (diff)
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 <markus.lehtonen@linux.intel.com>
-rw-r--r--gbp/notifications.py2
1 files changed, 1 insertions, 1 deletions
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")