diff mercurial/__init__.py @ 43091:127cc1f72e70

py3: stop normalizing .encode()/.decode() arguments to unicode Now that we don't byte transform string literals, we no longer need this transform. While we're here, we also drop some superfluous u'' prefix in existing callers. Differential Revision: https://phab.mercurial-scm.org/D7011
author Gregory Szorc <gregory.szorc@gmail.com>
date Sun, 06 Oct 2019 17:27:51 -0400
parents 1f339b503a40
children c95b2f40db7c
line wrap: on
line diff
--- a/mercurial/__init__.py	Sun Oct 06 16:58:55 2019 -0400
+++ b/mercurial/__init__.py	Sun Oct 06 17:27:51 2019 -0400
@@ -166,14 +166,6 @@
                     if arg1idx is not None:
                         _ensureunicode(arg1idx)
 
-                # .encode() and .decode() on str/bytes/unicode don't accept
-                # byte strings on Python 3.
-                elif fn in ('encode', 'decode') and _isop(i - 1, '.'):
-                    for argn in range(2):
-                        argidx = _findargnofcall(argn)
-                        if argidx is not None:
-                            _ensureunicode(argidx)
-
                 # It changes iteritems/values to items/values as they are not
                 # present in Python 3 world.
                 elif fn in ('iteritems', 'itervalues') and not (
@@ -190,7 +182,7 @@
     # ``replacetoken`` or any mechanism that changes semantics of module
     # loading is changed. Otherwise cached bytecode may get loaded without
     # the new transformation mechanisms applied.
-    BYTECODEHEADER = b'HG\x00\x12'
+    BYTECODEHEADER = b'HG\x00\x13'
 
     class hgloader(importlib.machinery.SourceFileLoader):
         """Custom module loader that transforms source code.