Show More
@@ -171,8 +171,7 b' if sys.version_info[0] >= 3:' | |||
|
171 | 171 | r, c = t.start |
|
172 | 172 | l = ( |
|
173 | 173 | b'; from mercurial.pycompat import ' |
|
174 |
b'delattr, getattr, hasattr, setattr |
|
|
175 | b'unicode\n' | |
|
174 | b'delattr, getattr, hasattr, setattr\n' | |
|
176 | 175 | ) |
|
177 | 176 | for u in tokenize.tokenize(io.BytesIO(l).readline): |
|
178 | 177 | if u.type in (tokenize.ENCODING, token.ENDMARKER): |
@@ -221,7 +220,7 b' if sys.version_info[0] >= 3:' | |||
|
221 | 220 | # ``replacetoken`` or any mechanism that changes semantics of module |
|
222 | 221 | # loading is changed. Otherwise cached bytecode may get loaded without |
|
223 | 222 | # the new transformation mechanisms applied. |
|
224 |
BYTECODEHEADER = b'HG\x00\x0 |
|
|
223 | BYTECODEHEADER = b'HG\x00\x0e' | |
|
225 | 224 | |
|
226 | 225 | class hgloader(importlib.machinery.SourceFileLoader): |
|
227 | 226 | """Custom module loader that transforms source code. |
@@ -367,7 +367,7 b' def obfuscate(text):' | |||
|
367 | 367 | """Any text. Returns the input text rendered as a sequence of |
|
368 | 368 | XML entities. |
|
369 | 369 | """ |
|
370 | text = unicode(text, pycompat.sysstr(encoding.encoding), r'replace') | |
|
370 | text = pycompat.unicode(text, pycompat.sysstr(encoding.encoding), r'replace') | |
|
371 | 371 | return b''.join([b'&#%d;' % ord(c) for c in text]) |
|
372 | 372 | |
|
373 | 373 |
General Comments 0
You need to be logged in to leave comments.
Login now