From 9619f7a7544f640811827968c5c6f54197dc11a6 Mon Sep 17 00:00:00 2001 From: Tobias Witek Date: Sat, 12 Aug 2017 17:13:02 +0200 Subject: [PATCH] [modules/datetime] Fix for Python3 --- bumblebee/modules/datetime.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bumblebee/modules/datetime.py b/bumblebee/modules/datetime.py index a8842c6..b116ee9 100644 --- a/bumblebee/modules/datetime.py +++ b/bumblebee/modules/datetime.py @@ -36,6 +36,9 @@ class Module(bumblebee.engine.Module): def get_time(self, widget): enc = locale.getpreferredencoding() - return datetime.datetime.now().strftime(self._fmt).decode(enc) + retval = datetime.datetime.now().strftime(self._fmt) + if hasattr(retval, "decode"): + return retval.decode(enc) + return retval # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4