I kill Python processes with SIGQUIT by pressing Ctrl\ sometimes (usually my own that are misbehaving). Can I prevent the "Python quit unexpectedly" message? I know I can just hit escape, so it's not so bad.
Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.Sign up to join this community
The default behavior when receiving SIGQUIT is to dump core and exit; the crash reporter is triggered as a part of this process.
Starting with 10.5(?) simply setting a signal handler for SIGQUIT should be sufficient to avoid the crash reporter; you will probably want the handler to also call exit.
import signal, sys, os def sigquit_handler(signum, frame): print 'SIGQUIT received; exiting' sys.exit(os.EX_SOFTWARE) signal.signal(signal.SIGQUIT, sigquit_handler) # Do your normal work instead of this print 'Waiting for a signal...' signal.pause()
The above code was tested on 10.8.5 against
/usr/bin/python which is 2.7.2.