# HG changeset patch # User Yuya Nishihara # Date 2019-11-05 12:29:40 # Node ID 822202e72f69ecd5fedb5e4658ae68f728286e96 # Parent e7eb67eab53fc33e4ef1998cdc233869cf2840b1 py3: do not reimplement Abort.__str__() on Python 2 It isn't necessary on Python 2, and the default implementation should be better than our BaseException_str() clone. diff --git a/mercurial/error.py b/mercurial/error.py --- a/mercurial/error.py +++ b/mercurial/error.py @@ -111,8 +111,10 @@ class Abort(Hint, Exception): __bytes__ = _tobytes - def __str__(self): - return pycompat.sysstr(self.__bytes__()) + if pycompat.ispy3: + + def __str__(self): + return pycompat.sysstr(self.__bytes__()) class HookLoadError(Abort):