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 &lt;<a href="mailto:dinov@exchange.microsoft.com">dinov@exchange.microsoft.com</a>&gt;:<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. &nbsp;It&#39;s probably a bug in the interpreter as writing the snippet out and executing w/ execfile, which doesn&#39;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. &nbsp;In beta 3 the interpreter is also now always used for exec or eval - previously it avoided certain constructs it couldn&#39;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>
&gt;&gt;&gt; s = &#39;&#39;&#39;<br>
... def body(context):<br>
... &nbsp; &nbsp; def ccall():<br>
... &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; body = lambda: None<br>
... &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; context.update(locals())<br>
... &nbsp; &nbsp; ccall()<br>
...<br>
... &#39;&#39;&#39;<br>
&gt;&gt;&gt; d = {}<br>
&gt;&gt;&gt; exec s in d<br>
&gt;&gt;&gt; c = {}<br>
&gt;&gt;&gt; d[&#39;body&#39;](c)<br>
Traceback (most recent call last):<br>
 &nbsp;File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;<br>
 &nbsp;File &quot;&quot;, line unknown, in Interpreted_body_1<br>
NameError: name &#39;locals&#39; is not defined<br>
<br>
This works fine in CPython:<br>
<br>
&gt;&gt;&gt; s = &#39;&#39;&#39;<br>
... def body(context):<br>
... &nbsp; &nbsp; def ccall():<br>
... &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; body = lambda: None<br>
... &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; context.update(locals())<br>
... &nbsp; &nbsp; ccall()<br>
...<br>
... &#39;&#39;&#39;<br>
&gt;&gt;&gt; exec s in d<br>
&gt;&gt;&gt; c = {}<br>
&gt;&gt;&gt; d[&#39;body&#39;](c)<br>
&gt;&gt;&gt; c<br>
{&#39;body&#39;: &lt;function &lt;lambda&gt; at 0x0359CCB0&gt;, &#39;context&#39;: {...}}<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>