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.
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: https://github.com/bazelbuild/rules_python/issues/2414