Why doesn't an undefined name in an "except" raise a NameError?
<p>I was surprised today to see that the following works with no exceptions (in Python 2.7.3 at least):</p>

<pre><code>&gt;&gt;&gt; try:
...     pass
... except ThingThatDoesNotExist:
...     print "bad"
...
&gt;&gt;&gt;
</code></pre>

<p>I would have thought that this should raise a <code>NameError</code> in the REPL, similar to how the following would:</p>

<pre><code>&gt;&gt;&gt; x = ThingThatDoesNotExist
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
NameError: name 'ThingThatDoesNotExist' is not defined
</code></pre>

<p>Anyone have any idea what's going on here?</p>
