From 12a3aa54568a5adbc943270310ad4dbfbf872534 Mon Sep 17 00:00:00 2001 From: Tobias Witek Date: Thu, 11 May 2017 19:43:59 +0200 Subject: [PATCH] [modules/stock] Modify symbol decoding for Python3 compatibility In Python3, string doesn't have a "decode" method. I will need to find a proper fix for this, but for now, the workaround seems to do the trick. --- bumblebee/modules/stock.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bumblebee/modules/stock.py b/bumblebee/modules/stock.py index 0e8b48a..2297c3a 100644 --- a/bumblebee/modules/stock.py +++ b/bumblebee/modules/stock.py @@ -33,7 +33,8 @@ class Module(bumblebee.engine.Module): self._currencies = '$' * len(self._symbols) # The currencies could be unicode, like the € symbol. Convert to a unicode object. - self._currencies = self._currencies.decode('utf-8', 'ignore') + if hasattr(self._currencies, "decode"): + self._currencies = self._currencies.decode("utf-8", "ignore") def value(self, widget): results = []