summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2014-05-16 00:33:29 -0400
committerJason R. Coombs <jaraco@jaraco.com>2014-05-16 00:33:29 -0400
commitca81c75a8e327ddf7ef2ee1c6c7269271a093a57 (patch)
tree36ab9ba3c92b9600ad549573ff692a2400fa19f5
parente190940162f71a4ba37072cbfb9db4f4e03990e1 (diff)
downloadpython-setuptools-bitbucket-ca81c75a8e327ddf7ef2ee1c6c7269271a093a57.tar.gz
Move Python 3 code to the body of the function
-rwxr-xr-xsetuptools/command/egg_info.py17
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):