# HG changeset patch # User Martin von Zweigbergk # Date 1618893084 25200 # Node ID abd18d6306f15da1d386dd1fbe704b0f66c64f77 # Parent 75351b8b20821514f59c9cee9bf557e6de7589ea errors: remove unnecessary varargs handling from OutOfBandError In my recent D10465, I moved some code over from scmutil into `OutOfBandError.__init__`. The code was written to deal with an arbitrary number of `message` arguments to the constructor. It turns out that we only ever pass 0 or 1. Given that, let's simplify it. Differential Revision: https://phab.mercurial-scm.org/D10483 diff -r 75351b8b2082 -r abd18d6306f1 mercurial/error.py --- a/mercurial/error.py Mon Apr 19 11:10:16 2021 +0200 +++ b/mercurial/error.py Mon Apr 19 21:31:24 2021 -0700 @@ -311,16 +311,15 @@ class OutOfBandError(RemoteError): """Exception raised when a remote repo reports failure""" - def __init__(self, *messages, **kwargs): + def __init__(self, message=None, hint=None): from .i18n import _ - if messages: - message = _(b"remote error:\n%s") % b''.join(messages) + if message: # Abort.format() adds a trailing newline - message = message.rstrip(b'\n') + message = _(b"remote error:\n%s") % message.rstrip(b'\n') else: message = _(b"remote error") - super(OutOfBandError, self).__init__(message, **kwargs) + super(OutOfBandError, self).__init__(message, hint=hint) class ParseError(Abort):