##// END OF EJS Templates
py3: change encoding.localstr to a subclass of bytes, not str
Yuya Nishihara -
r33810:dabe1f11 default
parent child Browse files
Show More
@@ -78,11 +78,11 b' except locale.Error:'
78 encodingmode = environ.get("HGENCODINGMODE", "strict")
78 encodingmode = environ.get("HGENCODINGMODE", "strict")
79 fallbackencoding = 'ISO-8859-1'
79 fallbackencoding = 'ISO-8859-1'
80
80
81 class localstr(str):
81 class localstr(bytes):
82 '''This class allows strings that are unmodified to be
82 '''This class allows strings that are unmodified to be
83 round-tripped to the local encoding and back'''
83 round-tripped to the local encoding and back'''
84 def __new__(cls, u, l):
84 def __new__(cls, u, l):
85 s = str.__new__(cls, l)
85 s = bytes.__new__(cls, l)
86 s._utf8 = u
86 s._utf8 = u
87 return s
87 return s
88 def __hash__(self):
88 def __hash__(self):
General Comments 0
You need to be logged in to leave comments. Login now