Mercurial > hg
changeset 43417:822202e72f69 stable
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.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Tue, 05 Nov 2019 21:29:40 +0900 |
parents | e7eb67eab53f |
children | ca3dca416f8d |
files | mercurial/error.py |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/error.py Mon Nov 04 20:57:31 2019 -0800 +++ b/mercurial/error.py Tue Nov 05 21:29:40 2019 +0900 @@ -111,8 +111,10 @@ __bytes__ = _tobytes - def __str__(self): - return pycompat.sysstr(self.__bytes__()) + if pycompat.ispy3: + + def __str__(self): + return pycompat.sysstr(self.__bytes__()) class HookLoadError(Abort):