title: traceback.format_exc/print_exc returns None when expecting traceback
body: <p>I can't figure out why traceback.format_exc() is returning "None" in the following example:</p>
  
  <pre><code>#!/usr/bin/env python
  
  import sys
  import traceback
  
  def my_excepthook(type, value, tb):
      print type.__name__
      print value
      # the problem: why does this return "None"?
      print traceback.format_exc(tb) # see http://docs.python.org/library/traceback.html#traceback.format_exc
  
  sys.excepthook = my_excepthook # see http://docs.python.org/library/sys.html#sys.excepthook
  
  # some code to generate a naturalistic exception
  a = "text"
  b = 5
  error = a + b
  </code></pre>
  
  <p>Using Python 2.7.1, I get the following output:</p>
  
  <pre><code>TypeError
  cannot concatenate 'str' and 'int' objects
  None
  </code></pre>
  
  <p>Instead of "None" on the 3rd line, I'd expect to get what happens when I comment out the sys.excepthook line:</p>
  
  <pre><code>Traceback (most recent call last):
    File "log-test.py", line 17, in &lt;module&gt;
      error = a+b 
  </code></pre>