catch SIGBREAK on windows.
authorVadim Gelfer <vadim.gelfer@gmail.com>
Wed, 19 Apr 2006 11:17:13 -0700
changeset 2092 1d3c6e63d703
parent 2091 fb8b35b0def9
child 2093 5cc414722587
catch SIGBREAK on windows.
mercurial/commands.py
--- 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()