[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.
This commit is contained in:
Tobias Witek 2017-05-11 19:43:59 +02:00
parent c73a3cfa34
commit 12a3aa5456

View file

@ -33,7 +33,8 @@ class Module(bumblebee.engine.Module):
self._currencies = '$' * len(self._symbols) self._currencies = '$' * len(self._symbols)
# The currencies could be unicode, like the € symbol. Convert to a unicode object. # 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): def value(self, widget):
results = [] results = []