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
If you never want to see the crash report dialogs, there is a preference to disable them:
defaults write com.apple.CrashReporter DialogType none
Log out and back in to apply the changes.
You can also make the message appear as a notification instead:
defaults write com.apple.CrashReporter UseUNC 1
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.