1#!/usr/bin/python
2
3from PyObjCTools import Signals
4Signals.dumpStackOnFatalSignal()
5
6import os
7import signal
8
9## all this does is set up an interesting stack to
10## to show that a backtrace really is being
11## generated.  Try commenting out the
12## Signals.dumpStackOnFatalSignal() line above and run
13## the script again.
14
15def badness():
16    os.kill(os.getpid(), signal.SIGQUIT)
17
18class Foo:
19    def baz(self):
20        badness()
21
22    def bar(self):
23        self.baz()
24
25Foo().bar()
26