From 6b55b9ac909a44b4babb0350cb6117ba6c5b270e Mon Sep 17 00:00:00 2001 From: Ultrabug Date: Thu, 20 Feb 2014 14:07:17 +0100 Subject: python3 compatibility code wrt issue #24 --- py3status/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'py3status') diff --git a/py3status/__init__.py b/py3status/__init__.py index d1bc025..34e1934 100755 --- a/py3status/__init__.py +++ b/py3status/__init__.py @@ -152,6 +152,11 @@ class I3status(Thread): for item in json_list: if item['name'] in ['time', 'tztime']: i3status_time = item['full_text'].encode('UTF-8', 'replace') + try: + # python3 compatibility code + i3status_time = i3status_time.decode() + except: + pass # add mendatory items in i3status time format wrt issue #18 for fmt in ['%Y', '%m', '%d']: if not fmt in time_format: -- cgit v1.3