D7463: wireprotov1server: capture Abort type before accessing the `hint` attribute

mharbison72 (Matt Harbison) phabricator at mercurial-scm.org
Thu Nov 21 03:27:39 UTC 2019


mharbison72 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Although the previous code worked, pytypes complained because `exc` is caught
  above as `BundleValueError, Abort, PushRaced`, and the other two don't have this
  attribute.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7463

AFFECTED FILES
  mercurial/wireprotov1server.py

CHANGE DETAILS

diff --git a/mercurial/wireprotov1server.py b/mercurial/wireprotov1server.py
--- a/mercurial/wireprotov1server.py
+++ b/mercurial/wireprotov1server.py
@@ -679,7 +679,7 @@
             if not getattr(exc, 'duringunbundle2', False):
                 try:
                     raise
-                except error.Abort:
+                except error.Abort as exc:
                     # The old code we moved used procutil.stderr directly.
                     # We did not change it to minimise code change.
                     # This need to be moved to something proper.



To: mharbison72, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list