From 4b38186b518244ebbd91bf53073d273f32d70ae6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonel=20C=C3=A2mara?= Date: Wed, 6 Sep 2017 15:37:51 +0100 Subject: [PATCH] simplify condition if you ain't got decode you ain't bytes --- gluon/_compat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gluon/_compat.py b/gluon/_compat.py index e5fcbdd8..a61ddc51 100644 --- a/gluon/_compat.py +++ b/gluon/_compat.py @@ -151,7 +151,7 @@ def with_metaclass(meta, *bases): def to_unicode(obj, charset='utf-8', errors='strict'): if obj is None: return None - if not hasattr(obj, 'decode') and not isinstance(obj, bytes): + if not hasattr(obj, 'decode'): return text_type(obj) return obj.decode(charset, errors)