From e8f6f7737ad569afd5ebfea0a27a9cfd89c64370 Mon Sep 17 00:00:00 2001 From: Collin Watson Date: Tue, 17 Jan 2012 08:07:42 -0800 Subject: [PATCH] Explicitly chack for instances of bytes to distinguish between py2 and py3. --- clint/textui/colored.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clint/textui/colored.py b/clint/textui/colored.py index 7ff3878..0906dde 100644 --- a/clint/textui/colored.py +++ b/clint/textui/colored.py @@ -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