-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
- Loading branch information
There are no files selected for viewing
3 comments
on commit 25dcca2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This breaks builds on Linux because you iterate over two generators in searched
: after the first iteration over directories for the first lib_name, then generator will be empty as it's not cyclic. Fix it by converting generators to lists like so:
lib_names = list(
self.library_filename(lib, lib_type=type)
for type in 'dylib xcode_stub shared static'.split()
)
searched = list(
os.path.join(root, lib_name)
for root in map(self._library_root, dirs)
for lib_name in lib_names
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the report. I'd say too that distutils should grow a test for this function. I did test the iteration, but using 'abc':
[(x, y) for x in iter('abc') for y in iter('xyz')]
[('a', 'x'),
('a', 'y'),
('a', 'z'),
('b', 'x'),
('b', 'y'),
('b', 'z'),
('c', 'x'),
('c', 'y'),
('c', 'z')]
But now I realize that the reason that works is because iter('xyz')
gets re-evaluated during each loop of 'abc':
>>> xyz = iter('xyz')
>>> [(x, y) for x in iter('abc') for y in xyz]
[('a', 'x'), ('a', 'y'), ('a', 'z')]
Yes. lib_names
needs to be materialized somehow. I don't think searched
does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filed pypa/distutils#164 to track.
It seems this commit breaks Pillow builds on linux based systems, see python-pillow/Pillow#6471