summaryrefslogtreecommitdiff
path: root/setuptools/command/easy_install.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2013-09-02 14:21:33 -0400
committerJason R. Coombs <jaraco@jaraco.com>2013-09-02 14:21:33 -0400
commitb0a0338b21b29acb1b8c8956cb40fbfd9c8edd04 (patch)
tree14b4f6c77e1f08f1f8374fcdafef9540bcff6c00 /setuptools/command/easy_install.py
parentcaf6636635bb195b6e1a0bf3a43d3b4084c32b8b (diff)
downloadpython-setuptools-bitbucket-b0a0338b21b29acb1b8c8956cb40fbfd9c8edd04.tar.gz
Refactor for nicer indentation
Diffstat (limited to 'setuptools/command/easy_install.py')
-rwxr-xr-xsetuptools/command/easy_install.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py
index 7aff9c84..755b15d6 100755
--- a/setuptools/command/easy_install.py
+++ b/setuptools/command/easy_install.py
@@ -81,14 +81,13 @@ def is_64bit():
return struct.calcsize("P") == 8
def samefile(p1, p2):
- if hasattr(os.path,'samefile') and (
- os.path.exists(p1) and os.path.exists(p2)
- ):
- return os.path.samefile(p1,p2)
- return (
- os.path.normpath(os.path.normcase(p1)) ==
- os.path.normpath(os.path.normcase(p2))
- )
+ both_exist = os.path.exists(p1) and os.path.exists(p2)
+ use_samefile = hasattr(os.path, 'samefile') and both_exist
+ if use_samefile:
+ return os.path.samefile(p1, p2)
+ norm_p1 = os.path.normpath(os.path.normcase(p1))
+ norm_p2 = os.path.normpath(os.path.normcase(p2))
+ return norm_p1 == norm_p2
if sys.version_info <= (3,):
def _to_ascii(s):