Skip to content

Commit

Permalink
[modules/datetime] Fix for Python3
Browse files Browse the repository at this point in the history
  • Loading branch information
tobi-wan-kenobi committed Aug 12, 2017
1 parent 9f69cc6 commit 9619f7a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bumblebee/modules/datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ def __init__(self, engine, config):

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

0 comments on commit 9619f7a

Please sign in to comment.