[modules/datetime] Fix for Python3
This commit is contained in:
parent
9f69cc6ae9
commit
9619f7a754
1 changed files with 4 additions and 1 deletions
|
@ -36,6 +36,9 @@ class Module(bumblebee.engine.Module):
|
||||||
|
|
||||||
def get_time(self, widget):
|
def get_time(self, widget):
|
||||||
enc = locale.getpreferredencoding()
|
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
|
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|
||||||
|
|
Loading…
Reference in a new issue