[issue41918] exec fails to take locals into account when running list comprehensions or functions

2020-11-29 Thread patterns
patterns added the comment: Also occurs in Python 3.6.9 -- nosy: +patterns ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue41918] exec fails to take locals into account when running list comprehensions or functions

2020-11-13 Thread Nikolas Havrikov
Nikolas Havrikov added the comment: This issue also occurs in Python 3.8.6 -- nosy: +havrikov ___ Python tracker ___ ___ Python-bug

[issue41918] exec fails to take locals into account when running list comprehensions or functions

2020-11-13 Thread undefined blinded
undefined blinded added the comment: This seems to happen only when both arguments to exec are used: ``` Python 3.7.7 (default, Mar 10 2020, 15:43:27) [Clang 10.0.0 (clang-1000.11.45.5)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> exec('text = ["hallo"]

[issue41918] exec fails to take locals into account when running list comprehensions or functions

2020-10-14 Thread Quentin Peter
Quentin Peter added the comment: Fails for functions as well: ``` In [4]: exec(compile('print(my_var)\ndef a():\n print(my_var)\na()', '', 'exec'), globals(), {"my_var": 0}) 0 Traceback (most recent call last): File "", line 1, in exec(compile('print(my_var)\ndef a():\n print(my_var)\na()',