changeset 2092:1d3c6e63d703

catch SIGBREAK on windows.
author Vadim Gelfer <vadim.gelfer@gmail.com>
date Wed, 19 Apr 2006 11:17:13 -0700
parents fb8b35b0def9
children 5cc414722587
files mercurial/commands.py
diffstat 1 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Wed Apr 19 10:56:44 2006 -0700
+++ b/mercurial/commands.py	Wed Apr 19 11:17:13 2006 -0700
@@ -3249,11 +3249,9 @@
     return (cmd, cmd and i[0] or None, args, options, cmdoptions)
 
 def dispatch(args):
-    signal.signal(signal.SIGTERM, catchterm)
-    try:
-        signal.signal(signal.SIGHUP, catchterm)
-    except AttributeError:
-        pass
+    for name in 'SIGTERM', 'SIGHUP', 'SIGBREAK':
+        num = getattr(signal, name, None)
+        if num: signal.signal(num, catchterm)
 
     try:
         u = ui.ui()