changeset 33832:dabe1f11ae3a

py3: change encoding.localstr to a subclass of bytes, not str
author Yuya Nishihara <yuya@tcha.org>
date Mon, 14 Aug 2017 15:50:40 +0900
parents b3a41f4d837b
children 4ba863c88135
files mercurial/encoding.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/encoding.py	Sun Aug 13 11:10:35 2017 +0900
+++ b/mercurial/encoding.py	Mon Aug 14 15:50:40 2017 +0900
@@ -78,11 +78,11 @@
 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):