Skip to content

Commit 2629280

Browse files
committed
Prefer generator expression in VCRuntimeRedist
1 parent 1a9d873 commit 2629280

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

setuptools/msvc.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1406,11 +1406,11 @@ def VCRuntimeRedist(self):
14061406
)
14071407

14081408
# vcruntime path
1409-
for prefix, crt_dir in itertools.product(prefixes, crt_dirs):
1410-
path = join(prefix, arch_subdir, crt_dir, vcruntime)
1411-
if isfile(path):
1412-
return path
1413-
return None
1409+
candidate_paths = (
1410+
join(prefix, arch_subdir, crt_dir, vcruntime)
1411+
for (prefix, crt_dir) in itertools.product(prefixes, crt_dirs)
1412+
)
1413+
return next(filter(isfile, candidate_paths), None)
14141414

14151415
def return_env(self, exists=True):
14161416
"""

0 commit comments

Comments
 (0)