Skip to content

Conversation

@yannci
Copy link
Contributor

@yannci yannci commented Dec 6, 2022

In Python 3 list comprehensions were changed to create their own local scope. If we pass in different objects for the globals and locals to the exec function this leads to NameErrors in the list comprehension. SCons passes in two different dictionaries when calling exec on the the options files. To circumvent this issue, we rewrite the list comprehension to a loop.

For reference:
https://stackoverflow.com/questions/45132645/list-comprehension-in-exec-with-empty-locals-nameerror

In Python 3 list comprehensions were changed to create their own local
scope. If we pass in different objects for the `globals` and
`locals` to the `exec` function this leads to `NameErrors` in the list
comprehension. SCons passes in two different dictionaries when calling
`exec` on the the options files. To circumvent this issue, we rewrite
the list comprehension to a loop.

For reference:
https://stackoverflow.com/questions/45132645/list-comprehension-in-exec-with-empty-locals-nameerror
@ivanimanishi ivanimanishi merged commit a7e50f5 into ImageEngine:RB-10.4 Dec 19, 2022
@ivanimanishi ivanimanishi deleted the py3OptionsAdjustment branch December 19, 2022 22:53
@ivanimanishi ivanimanishi restored the py3OptionsAdjustment branch December 19, 2022 22:53
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.

2 participants