mirror of
https://github.com/kennethreitz/clint.git
synced 2026-06-05 06:46:16 +00:00
Explicitly chack for instances of bytes to distinguish between py2 and py3.
This commit is contained in:
@@ -62,7 +62,7 @@ class ColoredString(object):
|
||||
|
||||
def __unicode__(self):
|
||||
value = self.color_str
|
||||
if isinstance(value, str) and hasattr(value, 'decode'):
|
||||
if isinstance(value, bytes):
|
||||
return value.decode('utf8')
|
||||
return value
|
||||
|
||||
|
||||
Reference in New Issue
Block a user