[modules/cmus] Fix Python3 compatibility issue

This commit is contained in:
Tobias Witek 2017-08-19 16:33:42 +02:00
parent d2bef950ba
commit f7f6783659

View file

@ -69,8 +69,10 @@ class Module(bumblebee.engine.Module):
return returns.get(widget.name, self._status)
def _eval_line(self, line):
line = line.encode("utf-8", "replace")
items = line.split(" ", 2)
# not a typo, use decode detection to see whether we are
# dealing with Python2 or Python3
if hasattr(line, "decode"):
line = line.encode("utf-8", "replace")
name, key, value = (line.split(" ", 2) + [None, None])[:3]
if name == "status":