Patchwork cleanup: remove useless re-raises of KeyboardInterrupt

login
register
mail settings
Submitter Yuya Nishihara
Date May 3, 2017, 2:42 a.m.
Message ID <99314eecae135963d946.1493779352@mimosa>
Download mbox | patch
Permalink /patch/20393/
State Accepted
Headers show

Comments

Yuya Nishihara - May 3, 2017, 2:42 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1493777815 -32400
#      Wed May 03 11:16:55 2017 +0900
# Node ID 99314eecae135963d94655f163038bf36463a64e
# Parent  6cacc271ee0a9385be483314dc73be176a13c891
cleanup: remove useless re-raises of KeyboardInterrupt

KeyboardInterrupt is no longer a subclass of Exception since Python 2.5.

https://docs.python.org/2/whatsnew/2.5.html#pep-352-exceptions-as-new-style-classes
Augie Fackler - May 6, 2017, 4:56 p.m.
On Wed, May 03, 2017 at 11:42:32AM +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1493777815 -32400
> #      Wed May 03 11:16:55 2017 +0900
> # Node ID 99314eecae135963d94655f163038bf36463a64e
> # Parent  6cacc271ee0a9385be483314dc73be176a13c891
> cleanup: remove useless re-raises of KeyboardInterrupt

queued, thanks

Patch

diff --git a/mercurial/branchmap.py b/mercurial/branchmap.py
--- a/mercurial/branchmap.py
+++ b/mercurial/branchmap.py
@@ -67,8 +67,6 @@  def read(repo):
             partial.setdefault(label, []).append(node)
             if state == 'c':
                 partial._closednodes.add(node)
-    except KeyboardInterrupt:
-        raise
     except Exception as inst:
         if repo.ui.debugflag:
             msg = 'invalid branchheads cache'
diff --git a/mercurial/extensions.py b/mercurial/extensions.py
--- a/mercurial/extensions.py
+++ b/mercurial/extensions.py
@@ -171,8 +171,6 @@  def loadall(ui):
                 continue
         try:
             load(ui, name, path)
-        except KeyboardInterrupt:
-            raise
         except Exception as inst:
             inst = _forbytes(inst)
             if path: