From 7e1e0204436cb304245382fd2761d063a5798bac Mon Sep 17 00:00:00 2001 From: Naya Verdier Date: Sun, 6 Aug 2017 11:46:05 -0700 Subject: [PATCH] [module/datetime] Fix case when no locale is set --- bumblebee/modules/datetime.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bumblebee/modules/datetime.py b/bumblebee/modules/datetime.py index 64df23e..533261a 100644 --- a/bumblebee/modules/datetime.py +++ b/bumblebee/modules/datetime.py @@ -31,12 +31,14 @@ class Module(bumblebee.engine.Module): super(Module, self).__init__(engine, config, bumblebee.output.Widget(full_text=self.get_time)) self._fmt = self.parameter("format", default_format(self.name)) - self._lcl = self.parameter("locale").split(".") + lcl = self.parameter("locale") # can't use the default in "parameter" because we split the # string, while 'getdefaultlocale' already returns a tuple - if self._lcl is None: + if lcl is None: self._lcl = locale.getdefaultlocale() + else: + self._lcl = lcl.split(".") locale.setlocale(locale.LC_TIME, self._lcl) def get_time(self, widget):