X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1fded56b375bf7a4687af1cdb182899614c1b2a8..f74172ab4256c9e7c665e44e2f94ce12bf84a37f:/wxPython/src/_extras.py?ds=sidebyside diff --git a/wxPython/src/_extras.py b/wxPython/src/_extras.py index 1cc71d3a8b..ce9dcdb12e 100644 --- a/wxPython/src/_extras.py +++ b/wxPython/src/_extras.py @@ -970,6 +970,15 @@ of your Mac.""" if redirect: self.RedirectStdio(filename) + # Set the default handler for SIGINT. This fixes a problem + # where if Ctrl-C is pressed in the console that started this + # app then it will not appear to do anything, (not even send + # KeyboardInterrupt???) but will later segfault on exit. By + # setting the default handler then the app will exit, as + # expected (depending on platform.) + import signal + signal.signal(signal.SIGINT, signal.SIG_DFL) + # this initializes wxWindows and then calls our OnInit _wxStart(self.OnInit)