[kupfer] browser: Catch SIGINT with signal handler
- From: Ulrik Sverdrup <usverdrup src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [kupfer] browser: Catch SIGINT with signal handler
- Date: Wed, 9 Sep 2009 19:16:09 +0000 (UTC)
commit 6641c01fec049cc486cc41f4435d7a496b7cc611
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date: Wed Sep 9 13:36:41 2009 +0200
browser: Catch SIGINT with signal handler
Explicitly override Python's ^C handler, so that we are sure to get
the signal on the main thread, without the threading problems of
Python's KeyboardInterrupt exception.
kupfer/browser.py | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
---
diff --git a/kupfer/browser.py b/kupfer/browser.py
index b02116d..16cb0b2 100644
--- a/kupfer/browser.py
+++ b/kupfer/browser.py
@@ -1354,6 +1354,7 @@ class WindowController (pretty.OutputMixin):
keyobj = keybindings.GetKeyboundObject()
keyobj.connect("keybinding", self._key_binding)
+ signal.signal(signal.SIGINT, self._sigterm)
signal.signal(signal.SIGTERM, self._sigterm)
signal.signal(signal.SIGHUP, self._sigterm)
@@ -1400,9 +1401,6 @@ class WindowController (pretty.OutputMixin):
# put away window *before exiting further*
self.put_away()
do_main_iterations(10)
- except KeyboardInterrupt, info:
- self.output_info(info, "exiting.. (Warning: Ctrl-C in the shell",
- "will kill child processes)")
finally:
self.save_data()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]