Patchwork D10474: errors: define OutOfBandError in py2-compatible way

login
register
mail settings
Submitter phabricator
Date April 20, 2021, 4:08 a.m.
Message ID <differential-rev-PHID-DREV-wmlzx32rpej7pbxy27m6-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48791/
State Superseded
Headers show

Comments

phabricator - April 20, 2021, 4:08 a.m.
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  CI reports that my D10465 <https://phab.mercurial-scm.org/D10465> does not work on py2 because (it seems)
  single keyword arguments are not allowed after `*args`; py2 seems to
  require `**kwargs` after `*args`.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/error.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/error.py b/mercurial/error.py
--- a/mercurial/error.py
+++ b/mercurial/error.py
@@ -311,7 +311,7 @@ 
 class OutOfBandError(RemoteError):
     """Exception raised when a remote repo reports failure"""
 
-    def __init__(self, *messages, hint=None):
+    def __init__(self, *messages, **kwargs):
         # type: (Any, Optional[bytes]) -> None
         from .i18n import _
 
@@ -321,7 +321,7 @@ 
             message = message.rstrip(b'\n')
         else:
             message = _(b"remote error")
-        super(OutOfBandError, self).__init__(message, hint=hint)
+        super(OutOfBandError, self).__init__(message, **kwargs)
 
 
 class ParseError(Abort):