summaryrefslogtreecommitdiff
path: root/setuptools/command/egg_info.py
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
commit9d5d875b2ba0414eeef36aa135621cb214abe463 (patch)
treedf293808fd3469cd4d9fd59e3708d5c31c949c72 /setuptools/command/egg_info.py
parenta35ca3bb2f7e025270a7b305c133b57f917e0ef2 (diff)
downloadpython-setuptools-git-9d5d875b2ba0414eeef36aa135621cb214abe463.tar.gz
Move Python 3 code to the body of the function
Diffstat (limited to 'setuptools/command/egg_info.py')
-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):