changeset 40972:2393c4044214

py3: unimplement RevlogError.__str__() On Python 2, str(exc) would crash if __str__() returned a unicode containing non-ASCII characters.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 16 Dec 2018 17:55:08 +0900
parents 8c8fcb385c46
children 97484e1d1834
files mercurial/error.py
diffstat 1 files changed, 0 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/error.py	Sun Dec 16 17:53:17 2018 +0900
+++ b/mercurial/error.py	Sun Dec 16 17:55:08 2018 +0900
@@ -44,14 +44,6 @@
 class RevlogError(StorageError):
     __bytes__ = _tobytes
 
-    def __str__(self):
-        # avoid cycle, and directly implement unimethod for this
-        # __str__ to allow delaying the import of encoding until
-        # someone actually wants the __str__ of a RevlogError (which
-        # should be very rare).
-        from . import encoding
-        return encoding.unifromlocal(_tobytes(self))
-
 class FilteredIndexError(IndexError):
     __bytes__ = _tobytes