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 mcherm
Recipients
Date 2005-03-30.12:40:31
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=99874

I can confirm this... it appears that things which are set
in the global scope within an "exec ... in {}, {}" are not
then correctly accessed in the global scope when being read.
The following two examples illustrate the problem:

>>> exec """\
... x = 3
... def f():
...     global x
...     print x
... f()
... """ in {}, {}
3

... and again without the global definition:

>>> exec """\
... x = 3
... def f():
...     print x
... f()
... """ in {}, {}
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "<string>", line 4, in ?
  File "<string>", line 3, in f
NameError: global name 'x' is not defined
History
Date User Action Args
2007-08-23 14:30:26adminlinkissue1167300 messages
2007-08-23 14:30:26admincreate