From 5fab111751d60751dc1e3f19a1fb0239f21e6098 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 16 Jul 2003 23:17:59 +0000 Subject: [PATCH] Fix for #764099. Instead of undoing Python's signal handlers and module, just set SIG_DFL for SIGINT. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@22031 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/src/msw/wx.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/wxPython/src/msw/wx.py b/wxPython/src/msw/wx.py index 8fe466a533..70376b2d65 100644 --- a/wxPython/src/msw/wx.py +++ b/wxPython/src/msw/wx.py @@ -1941,6 +1941,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)