From 52245f7a59d47d83038bf729415b0ace068a9f9e Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 22 Sep 2003 22:26:08 +0000 Subject: [PATCH] Catch exception when signal is used in the non-main thread git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@23835 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/src/_extras.py | 7 +++++-- wxPython/src/gtk/wx.py | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/wxPython/src/_extras.py b/wxPython/src/_extras.py index ce9dcdb12e..735e3bf9c6 100644 --- a/wxPython/src/_extras.py +++ b/wxPython/src/_extras.py @@ -976,8 +976,11 @@ of your Mac.""" # 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) + try: + import signal + signal.signal(signal.SIGINT, signal.SIG_DFL) + except: + pass # this initializes wxWindows and then calls our OnInit _wxStart(self.OnInit) diff --git a/wxPython/src/gtk/wx.py b/wxPython/src/gtk/wx.py index 33526ac813..9ccfdf704b 100644 --- a/wxPython/src/gtk/wx.py +++ b/wxPython/src/gtk/wx.py @@ -1941,8 +1941,11 @@ of your Mac.""" # 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) + try: + import signal + signal.signal(signal.SIGINT, signal.SIG_DFL) + except: + pass # this initializes wxWindows and then calls our OnInit _wxStart(self.OnInit)