# HG changeset patch # User Yuya Nishihara # Date 2017-08-14 06:50:40 # Node ID dabe1f11ae3aefab4d3a460b456a0e84507b6326 # Parent b3a41f4d837b2b3d090e693c449cbe6a8256a50f py3: change encoding.localstr to a subclass of bytes, not str diff --git a/mercurial/encoding.py b/mercurial/encoding.py --- a/mercurial/encoding.py +++ b/mercurial/encoding.py @@ -78,11 +78,11 @@ except locale.Error: encodingmode = environ.get("HGENCODINGMODE", "strict") fallbackencoding = 'ISO-8859-1' -class localstr(str): +class localstr(bytes): '''This class allows strings that are unmodified to be round-tripped to the local encoding and back''' def __new__(cls, u, l): - s = str.__new__(cls, l) + s = bytes.__new__(cls, l) s._utf8 = u return s def __hash__(self):