Should be fixed in latest 1.1 alpha 
(http://www.codeplex.com/IronPython/Release/ProjectReleases.aspx?ReleaseId=161).
 The issue is same as 
http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=5755

Thanks for reporting this.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Christian 
Muirhead
Sent: Friday, January 05, 2007 2:06 AM
To: [email protected]
Subject: [IronPython] import * in exec

Hi -

We have a case where we'd like to be able to use "from lib import *" in
some code that is exec-ed with a context dictionary. This doesn't appear
to work in IronPython:


ipy:

(func1 is defined in lib.py)
 >>> ctx = {}
 >>> exec("from lib import *", ctx)
 >>> ctx
{}
 >>> func1
<function func1 at 0x000000000000002B>


cpython:

 >>> ctx = {}
 >>> exec("from lib import *", ctx)
 >>> ctx
{massive amount of stuff, including names defined in lib}
 >>> func1

Traceback (most recent call last):
   File "<pyshell#8>", line 1, in <module>
     func1
NameError: name 'func1' is not defined


Thanks,
Christian

--
Christian Muirhead
Resolver Systems
[EMAIL PROTECTED]

Office address:     17a Clerkenwell Road, London EC1M 5RD, UK
Registered address: 843 Finchley Road, London NW11 8NA, UK

Resolver Systems Limited is registered in England and Wales as company
number 5467329.
_______________________________________________
users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
_______________________________________________
users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to