diff options
Diffstat (limited to 'setuptools/unicode_utils.py')
-rw-r--r-- | setuptools/unicode_utils.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/setuptools/unicode_utils.py b/setuptools/unicode_utils.py index 18903d9e..6eee6351 100644 --- a/setuptools/unicode_utils.py +++ b/setuptools/unicode_utils.py @@ -22,11 +22,13 @@ def filesys_decode(path): NONE when no expected encoding works """ - fs_enc = sys.getfilesystemencoding() if isinstance(path, six.text_type): return path - for enc in (fs_enc, "utf-8"): + fs_enc = sys.getfilesystemencoding() + candidates = fs_enc, 'utf-8' + + for enc in candidates: try: return path.decode(enc) except UnicodeDecodeError: |