diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2015-03-06 23:36:10 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2015-03-06 23:36:10 -0500 |
commit | e4fe5c76f89d0249ff7035a38795fa5ae1e38f09 (patch) | |
tree | 8b9edb6b099ed8c49424d6e65a0260ee09b138ea /setuptools/command/easy_install.py | |
parent | 7ab342a1ed684563ee7742fc3f7fd04fac5b7fc2 (diff) | |
download | python-setuptools-git-e4fe5c76f89d0249ff7035a38795fa5ae1e38f09.tar.gz |
Short circuit on dry run
Diffstat (limited to 'setuptools/command/easy_install.py')
-rwxr-xr-x | setuptools/command/easy_install.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 7dbbc878..7f360e05 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -208,12 +208,14 @@ class easy_install(Command): def _delete_filename(self, filename): log.info("Deleting %s", filename) - if not self.dry_run: - if (os.path.isdir(filename) and - not os.path.islink(filename)): - rmtree(filename) - else: - os.unlink(filename) + if self.dry_run: + return + + if (os.path.isdir(filename) and + not os.path.islink(filename)): + rmtree(filename) + else: + os.unlink(filename) def finalize_options(self): if self.version: |