self.last_exc_firstlineno = 0
def _trace(self, frame, event, arg_unused):
"""The trace function passed to sys.settrace."""
sys.stderr.write("trace event: %s %r @%d\n" % (
event, frame.f_code.co_filename, frame.f_lineno
if self.thread != threading.currentThread():
- # Called on a different thread than started us: do nothing.
+ # Called on a different thread than started us: we can't unhook
+ # ourseves, but we've set the flag that we should stop, so we won't
if hasattr(sys, "gettrace") and self.warn: