mercurial/dispatch.py
changeset 45102 efcc87d37f4d
parent 45101 9e6b86a8f438
child 45253 9b5723784aac
--- a/mercurial/dispatch.py	Mon Jul 13 21:06:34 2020 +0900
+++ b/mercurial/dispatch.py	Mon Jul 13 21:14:20 2020 +0900
@@ -140,8 +140,10 @@
                 status = -1
 
         _silencestdio()
-    finally:
-        pass
+    except KeyboardInterrupt:
+        # Catch early/late KeyboardInterrupt as last ditch. Here nothing will
+        # be printed to console to avoid another IOError/KeyboardInterrupt.
+        status = -1
     sys.exit(status & 255)