title: Catching exception from timer
body: <p>I am trying to create a watchdog class, that will throw an exception after specified time:</p>
  
  <pre><code>from threading import Timer
  from time import sleep
  
  class watchdog():
    def _timeout(self):
      #raise self
      raise TypeError
  
    def __init__(self):
      self.t = Timer(1, self._timeout)
  
    def start(self):
      self.t.start()
  
  try:
    w = watchdog()
    w.start()
    sleep(2)
  except TypeError, e:
    print "Exception caught"
  else:
    print "Of course I didn't catch the exception"
  </code></pre>
  
  <p>This exception is not caught, as the exception is thrown from completely different context, hence we will see the last message.</p>
  
  <p>My question is, how can I modify the code, so the exception will be caught?</p>