From d9de5582d21b62794bbdb39c0da11d711889c442 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 23 Dec 2014 10:04:35 -0500 Subject: Rewrite short-circuit for/if/else loop as any on generator expression. --- setuptools/command/build_ext.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'setuptools/command/build_ext.py') diff --git a/setuptools/command/build_ext.py b/setuptools/command/build_ext.py index b6eb89eb..dae9c81e 100644 --- a/setuptools/command/build_ext.py +++ b/setuptools/command/build_ext.py @@ -193,10 +193,7 @@ class build_ext(_build_ext): # XXX static-compiled version libnames = dict.fromkeys([lib._full_name for lib in self.shlibs]) pkg = '.'.join(ext._full_name.split('.')[:-1] + ['']) - for libname in ext.libraries: - if pkg + libname in libnames: - return True - return False + return any(pkg + libname in libnames for libname in ext.libraries) def get_outputs(self): outputs = _build_ext.get_outputs(self) -- cgit v1.2.3