From 4d3de3be0446877caa436bbc571b449fbb7fba71 Mon Sep 17 00:00:00 2001 From: Bernhard B Date: Fri, 25 Mar 2022 19:29:37 +0100 Subject: [PATCH] handle util.popup ImportError gracefully * util.popup requires tkinter to be installed (in order to display popups). As most people will probably use the default configuration of the pulseaudio module (where the popup is disabled) and in order to avoid breaking existing setups, we catch import errors and just log them. --- bumblebee_status/modules/core/pulseaudio.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bumblebee_status/modules/core/pulseaudio.py b/bumblebee_status/modules/core/pulseaudio.py index 1213fe9..906e1dd 100644 --- a/bumblebee_status/modules/core/pulseaudio.py +++ b/bumblebee_status/modules/core/pulseaudio.py @@ -43,8 +43,11 @@ import core.input import util.cli import util.graph import util.format -import util.popup +try: + import util.popup +except ImportError as e: + logging.warning("Couldn't import util.popup: %s. Popups won't work!", e) class Module(core.module.Module): def __init__(self, config, theme, channel):