Does this mean that issue 16884 will be fixed as well in beta 3?<div><br><br><div class="gmail_quote">2008/6/24 Dino Viehland <<a href="mailto:dinov@exchange.microsoft.com">dinov@exchange.microsoft.com</a>>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
It seems to be fixed in beta 3. It's probably a bug in the interpreter as writing the snippet out and executing w/ execfile, which doesn't run under the interpreter, works in beta 2 as well.<br>
<br>
The reason it got silently fixed was because between the two versions the interpreter was moved from M.S.Core.dll up to M.S.dll and a bunch of bugs were fixed along the way. In beta 3 the interpreter is also now always used for exec or eval - previously it avoided certain constructs it couldn't support.<br>
<div><div></div><div class="Wj3C7c"><br>
-----Original Message-----<br>
From: <a href="mailto:users-bounces@lists.ironpython.com">users-bounces@lists.ironpython.com</a> [mailto:<a href="mailto:users-bounces@lists.ironpython.com">users-bounces@lists.ironpython.com</a>] On Behalf Of Dan Eloff<br>
Sent: Monday, June 23, 2008 7:02 PM<br>
To: Discussion of IronPython<br>
Subject: [IronPython] NameError: locals() is not defined?<br>
<br>
In IronPython b2 I get:<br>
<br>
>>> s = '''<br>
... def body(context):<br>
... def ccall():<br>
... body = lambda: None<br>
... context.update(locals())<br>
... ccall()<br>
...<br>
... '''<br>
>>> d = {}<br>
>>> exec s in d<br>
>>> c = {}<br>
>>> d['body'](c)<br>
Traceback (most recent call last):<br>
File "<stdin>", line 1, in <module><br>
File "", line unknown, in Interpreted_body_1<br>
NameError: name 'locals' is not defined<br>
<br>
This works fine in CPython:<br>
<br>
>>> s = '''<br>
... def body(context):<br>
... def ccall():<br>
... body = lambda: None<br>
... context.update(locals())<br>
... ccall()<br>
...<br>
... '''<br>
>>> exec s in d<br>
>>> c = {}<br>
>>> d['body'](c)<br>
>>> c<br>
{'body': <function <lambda> at 0x0359CCB0>, 'context': {...}}<br>
<br>
Any idea why?<br>
<br>
Thanks,<br>
-Dan<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a><br>
<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a><br>
<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
</div></div></blockquote></div><br></div>