diff options
Diffstat (limited to 'setuptools/command')
| -rwxr-xr-x | setuptools/command/egg_info.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index 50c2096a..bb832ea6 100755 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -213,16 +213,15 @@ class FileList(_FileList): self.files.append(path) def _safe_path(self, path): - if PY3: - try: - if os.path.exists(path) or os.path.exists(path.encode('utf-8')): - return True - except UnicodeEncodeError: - log.warn("'%s' not %s encodable -- skipping", path, - sys.getfilesystemencoding()) - else: - if os.path.exists(path): + if not PY3: + return os.path.exists(path) + + try: + if os.path.exists(path) or os.path.exists(path.encode('utf-8')): return True + except UnicodeEncodeError: + log.warn("'%s' not %s encodable -- skipping", path, + sys.getfilesystemencoding()) class manifest_maker(sdist): |
