From f7f6783659334b86d63cc7a0e03ff71f8f0cc348 Mon Sep 17 00:00:00 2001 From: Tobias Witek Date: Sat, 19 Aug 2017 16:33:42 +0200 Subject: [PATCH] [modules/cmus] Fix Python3 compatibility issue --- bumblebee/modules/cmus.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bumblebee/modules/cmus.py b/bumblebee/modules/cmus.py index a442d55..6cd63bb 100644 --- a/bumblebee/modules/cmus.py +++ b/bumblebee/modules/cmus.py @@ -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":