Skip to content

Conversation

rickeylev
Copy link
Collaborator

The collect_imports() function added import strings from BuiltinPyInfo if it was non-None.
However, operator precedence caused the if-else ternary to ignore both list comprehensions
(one for PyInfo and one for BuiltinPyInfo) if BuiltinPyInfo was None.

To fix, I rewrote the function as a regular for loop to eliminate the ambiguous looking
ternary expression.

Fixes: #2414

@rickeylev rickeylev requested a review from aignas as a code owner November 15, 2024 21:03
@rickeylev rickeylev force-pushed the fix.missing.builtinpyinfo.erases.imports branch from f16551b to ffc3176 Compare November 15, 2024 21:07
@aignas aignas added this pull request to the merge queue Nov 16, 2024
Merged via the queue into bazel-contrib:main with commit b304fc6 Nov 16, 2024
4 checks passed
@rickeylev rickeylev deleted the fix.missing.builtinpyinfo.erases.imports branch November 16, 2024 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Removal of PyInfo from Bazel causes semantic change

2 participants