Bugs item #1167300, was opened at 2005-03-21 00:35
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1167300&group_id=5470

Category: Python Interpreter Core
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Stefan Seefeld (stefan)
Assigned to: Nobody/Anonymous (nobody)
Summary: Error "exec"ing python code

Initial Comment:
I'm trying to 'exec'ing the following code:

class Foo: pass
class Bar:
    f = Foo
    
The error appears when using 'exec f in {}, {}':

>>> f = ''.join(open('/home/stefan/t.py').readlines())
>>> exec f in {}, {}
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "<string>", line 2, in ?
  File "<string>", line 3, in Bar
NameError: name 'Foo' is not defined

I tested on python 2.3 and python 2.4, both show the same
behavior.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1167300&group_id=5470
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to