title: Python Decorator With Try/Except Not Raising Error
body: <p>I am experimenting with Python Decorators in order to understand what it happening and I have hit a head-scratcher.</p>
  
  <p>My code is this (python 2.7.6):</p>
  
  <pre><code>import traceback
  def dec(func):
      def wrapped(*args, **kwargs):
          try:
              if flag:
                  print 'flagged'
              else:
                  print 'unflagged'
          except NameError as e:
              print 'error?'
              raise
          finally:
              return func(*args, **kwargs)
      return wrapped
  
  @dec
  def foo(x):
      print x
  
  foo(3)
  </code></pre>
  
  <p>when run, the output is:</p>
  
  <pre><code>error?
  3
  </code></pre>
  
  <p>I expected that calling foo(3) would raise:</p>
  
  <pre><code>NameError: global name 'flag' is not defined
  </code></pre>
  
  <p>Why is the "raise" not raising? Clearly, the error is caught - the print from the Except block is executed...</p>