From 4a7207b0d0f31219f43e90ea1fcb425fe0a62eea Mon Sep 17 00:00:00 2001 From: Umair Khan Date: Wed, 13 Jul 2016 07:46:07 +0500 Subject: [PATCH] Only convert to unicode if str --- talon/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talon/utils.py b/talon/utils.py index e4bd19b..21bc45a 100644 --- a/talon/utils.py +++ b/talon/utils.py @@ -48,7 +48,7 @@ def to_unicode(str_or_unicode, precise=False): If `precise` flag is True, tries to guess the correct encoding first. """ encoding = quick_detect_encoding(str_or_unicode) if precise else 'utf-8' - if isinstance(str_or_unicode, str): + if not isinstance(str_or_unicode, six.text_type): return six.text_type(str_or_unicode, encoding, 'replace') return str_or_unicode