title: Exception traceback is hidden if not re-raised immediately
body: <p>I've got a piece of code similar to this:</p>
  
  <pre><code>import sys
  
  def func1():
      func2()
  
  def func2():
      raise Exception('test error')
  
  def main():
      err = None
  
      try:
          func1()
      except:
          err = sys.exc_info()[1]
          pass
  
      # some extra processing, involving checking err details (if err is not None)
  
      # need to re-raise err so caller can do its own handling
      if err:
          raise err
  
  if __name__ == '__main__':
      main()
  </code></pre>
  
  <p>When <code>func2</code> raises an exception I receive the following traceback:</p>
  
  <pre><code>Traceback (most recent call last):
    File "err_test.py", line 25, in &lt;module&gt;
      main()
    File "err_test.py", line 22, in main
      raise err
  Exception: test error
  </code></pre>
  
  <p>From here I don't see where the exception is coming from. The original traceback is lost.</p>
  
  <p>How can I preserve original traceback and re-raise it? I want to see something similar to this:</p>
  
  <pre><code>Traceback (most recent call last):
    File "err_test.py", line 26, in &lt;module&gt;
      main()
    File "err_test.py", line 13, in main
      func1()
    File "err_test.py", line 4, in func1
      func2()
    File "err_test.py", line 7, in func2
      raise Exception('test error')
  Exception: test error
  </code></pre>