This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author qpeter
Recipients qpeter
Date 2020-10-14.13:33:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1602682439.18.0.974388420301.issue41918@roundup.psfhosted.org>
In-reply-to
Content
Fails for functions as well:
```
In [4]: exec(compile('print(my_var)\ndef a():\n print(my_var)\na()', '<stdin>', 'exec'), globals(), {"my_var": 0})
0
Traceback (most recent call last):

File "<ipython-input-4-f091e49f2781>", line 1, in <module>
exec(compile('print(my_var)\ndef a():\n print(my_var)\na()', '<stdin>', 'exec'), globals(), {"my_var": 0})

File "<stdin>", line 4, in <module>

 File "<stdin>", line 3, in a

NameError: name 'my_var' is not defined
```
History
Date User Action Args
2020-10-14 13:33:59qpetersetrecipients: + qpeter
2020-10-14 13:33:59qpetersetmessageid: <1602682439.18.0.974388420301.issue41918@roundup.psfhosted.org>
2020-10-14 13:33:59qpeterlinkissue41918 messages
2020-10-14 13:33:59qpetercreate