Explicitly chack for instances of bytes to distinguish between py2 and py3.

This commit is contained in:
Collin Watson
2012-01-17 08:07:42 -08:00
parent 43b152cf0e
commit e8f6f7737a
+1 -1
View File
@@ -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