title: Is there a buildin(or 3rd party) function in Python to get the exception caught in context?
body: <p>Is there a function in Python, e.g. get_exception, so I can do this:</p>
  
  <pre><code>try:
      can_raise_anything()
  except:
      ex = *get_exception()*
      print('caught something: ' + str(ex))
  </code></pre>
  
  <p>I know in Python 3, I should use <code>except BaseException as ex:</code> to do the task. I'm just curious to see if there is a function can do that.</p>