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 | 9d5d875b2ba0414eeef36aa135621cb214abe463 (patch) | |
| tree | df293808fd3469cd4d9fd59e3708d5c31c949c72 /setuptools/command/egg_info.py | |
| parent | a35ca3bb2f7e025270a7b305c133b57f917e0ef2 (diff) | |
| download | python-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-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): |
