From 825f7dc7ea4f101f324619ddcc09276455166093 Mon Sep 17 00:00:00 2001 From: RedBug312 Date: Sun, 16 Jul 2017 13:18:06 +0800 Subject: [PATCH] except TypeError instead of UnicodeDecodeError --- tqdm/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tqdm/utils.py b/tqdm/utils.py index cb534eda..ee8a8769 100644 --- a/tqdm/utils.py +++ b/tqdm/utils.py @@ -293,6 +293,6 @@ def _text_width(s): # pragma: no cover else: try: return len(s) + sum(east_asian_width(ch) in 'FW' for ch in s) - except UnicodeDecodeError: # Py2 + except TypeError: # Py2 s = s.decode('utf-8') return len(s) + sum(east_asian_width(ch) in 'FW' for ch in s)