# HG changeset patch # User Gregory Szorc # Date 2022-02-21 17:27:02 # Node ID 9baec00b4ca112cbb51cfe3c7f983672bcc6878f # Parent 07a7b57d3e3360e2bbf0950ae6b464206255bfdf error: unconditionally define __str__ We always run on Python 3 now. Differential Revision: https://phab.mercurial-scm.org/D12292 diff --git a/mercurial/error.py b/mercurial/error.py --- a/mercurial/error.py +++ b/mercurial/error.py @@ -68,14 +68,12 @@ class Error(Hint, Exception): def __bytes__(self): return self.message - if pycompat.ispy3: - - def __str__(self): - # type: () -> str - # the output would be unreadable if the message was translated, - # but do not replace it with encoding.strfromlocal(), which - # may raise another exception. - return pycompat.sysstr(self.__bytes__()) + def __str__(self): + # type: () -> str + # the output would be unreadable if the message was translated, + # but do not replace it with encoding.strfromlocal(), which + # may raise another exception. + return pycompat.sysstr(self.__bytes__()) def format(self): # type: () -> bytes