From 3fe2088d06afca0ead454346d1933eac1f9cef42 Mon Sep 17 00:00:00 2001 From: Tobias Witek Date: Sun, 26 Nov 2017 19:56:57 +0100 Subject: [PATCH] [tests] fix unit tests --- bumblebee/theme.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bumblebee/theme.py b/bumblebee/theme.py index 41f2e32..b1b1324 100644 --- a/bumblebee/theme.py +++ b/bumblebee/theme.py @@ -36,7 +36,10 @@ class Theme(object): self._cycle = {} self._prevbg = None self._colorset = {} - self._init(self.load(name)) + data = self.load(name) + if not data: + raise bumblebee.error.ThemeLoadError("no such theme") + self._init(data) def _init(self, data): """Initialize theme from data structure""" @@ -148,8 +151,6 @@ class Theme(object): except ValueError as exception: raise bumblebee.error.ThemeLoadError("JSON error: {}".format(exception)) - if not result: - raise bumblebee.error.ThemeLoadError("no such theme") return result def _get(self, widget, name, default=None):