From 537c16561318df78f1a512101d0eca1b0593616e Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 6 Mar 2015 23:29:47 -0500 Subject: Filter blockers in the iterable --- setuptools/command/easy_install.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'setuptools/command/easy_install.py') diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 9f480f05..531ac8ff 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -200,8 +200,11 @@ class easy_install(Command): ) def delete_blockers(self, blockers): - for filename in blockers: - if os.path.exists(filename) or os.path.islink(filename): + extant_blockers = ( + filename for filename in blockers + if os.path.exists(filename) or os.path.islink(filename) + ) + for filename in extant_blockers: log.info("Deleting %s", filename) if not self.dry_run: if (os.path.isdir(filename) and -- cgit v1.2.3