diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2014-05-16 00:33:29 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2014-05-16 00:33:29 -0400 |
commit | ca81c75a8e327ddf7ef2ee1c6c7269271a093a57 (patch) | |
tree | 36ab9ba3c92b9600ad549573ff692a2400fa19f5 | |
parent | e190940162f71a4ba37072cbfb9db4f4e03990e1 (diff) | |
download | python-setuptools-bitbucket-ca81c75a8e327ddf7ef2ee1c6c7269271a093a57.tar.gz |
Move Python 3 code to the body of the function
-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): |