title: "except Foo as bar" causes "bar" to be removed from scope
body: <p>Given the following code:</p>
  
  <pre><code>msg = "test"
  try:
      "a"[1]
  except IndexError as msg:
      print("Error happened")
  print(msg)
  </code></pre>
  
  <p>Can somebody explain why this causes the following output in Python 3?</p>
  
  <pre class="lang-none prettyprint-override"><code>Error happened
  Traceback (most recent call last):
    File "test.py", line 6, in &lt;module&gt;
      print(msg)
  NameError: name 'msg' is not defined
  </code></pre>