summaryrefslogtreecommitdiff
path: root/setuptools
diff options
context:
space:
mode:
authorAnderson Bravalheri <andersonbravalheri@gmail.com>2022-02-27 18:57:50 +0000
committerAnderson Bravalheri <andersonbravalheri@gmail.com>2022-02-27 18:57:50 +0000
commit597ff8774e505803a565d9bebde2f8a48519b033 (patch)
tree9aa1eba30f4e1cdc04f3ad27949c472e75107671 /setuptools
parentfb7b30d64eb1475a0f5692e015ac123834ff6c40 (diff)
downloadpython-setuptools-git-597ff8774e505803a565d9bebde2f8a48519b033.tar.gz
Just check for if destination file exists
Diffstat (limited to 'setuptools')
-rw-r--r--setuptools/command/easy_install.py5
-rw-r--r--setuptools/package_index.py3
2 files changed, 4 insertions, 4 deletions
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py
index 80ff6347..6da39e73 100644
--- a/setuptools/command/easy_install.py
+++ b/setuptools/command/easy_install.py
@@ -922,8 +922,9 @@ class easy_install(Command):
ensure_directory(destination)
dist = self.egg_distribution(egg_path)
- both_exist = os.path.exists(egg_path) and os.path.exists(destination)
- if not (both_exist and os.path.samefile(egg_path, destination)):
+ if not (
+ os.path.exists(destination) and os.path.samefile(egg_path, destination)
+ ):
if os.path.isdir(destination) and not os.path.islink(destination):
dir_util.remove_tree(destination, dry_run=self.dry_run)
elif os.path.exists(destination):
diff --git a/setuptools/package_index.py b/setuptools/package_index.py
index 2c85ff2a..14881d29 100644
--- a/setuptools/package_index.py
+++ b/setuptools/package_index.py
@@ -680,8 +680,7 @@ class PackageIndex(Environment):
# Make sure the file has been downloaded to the temp dir.
if os.path.dirname(filename) != tmpdir:
dst = os.path.join(tmpdir, basename)
- both_exist = os.path.exists(filename) and os.path.exists(dst)
- if not (both_exist and os.path.samefile(filename, dst)):
+ if not (os.path.exists(dst) and os.path.samefile(filename, dst)):
shutil.copy2(filename, dst)
filename = dst