diff options
| author | Ultrabug <ultrabug@gentoo.org> | 2014-02-20 14:07:17 +0100 |
|---|---|---|
| committer | Ultrabug <ultrabug@gentoo.org> | 2014-02-20 14:07:17 +0100 |
| commit | 6b55b9ac909a44b4babb0350cb6117ba6c5b270e (patch) | |
| tree | 589f3849a95c638618d818bb6424eb3fe193a271 /py3status | |
| parent | 27f488eb3ce3cf3ea9326fab20e4b406a5f04444 (diff) | |
python3 compatibility code wrt issue #24
Diffstat (limited to 'py3status')
| -rwxr-xr-x | py3status/__init__.py | 5 |
1 files changed, 5 insertions, 0 deletions
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: |
