title: How in Python find where exception was raised
body: <p>How to determine in what function exception was raised. For example exist two functions: 'foo' and 'bar'. In 'foo' exception will raised randomly.</p>
  
  <pre><code>import random
  
  
  def foo():
      if random.randint(1, 10) % 2:
          raise Exception
      bar()
  
  
  def bar():
      raise Exception
  
  try:
      foo()
  except Exception as e:
      print "Exception raised in %s" % ???
  </code></pre>