changeset 31150:7c54917b31f6

py3: drop unrequired code from __init__.py Once we are using pycompat.open(), we don't need this hack to convert the second argument to unicodes. So removing this.
author Pulkit Goyal <7895pulkit@gmail.com>
date Fri, 03 Mar 2017 15:30:48 +0530
parents 76a64c1e5439
children 6d9f8bc2b5ea
files mercurial/__init__.py
diffstat 1 files changed, 1 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/__init__.py	Fri Mar 03 13:04:32 2017 +0530
+++ b/mercurial/__init__.py	Fri Mar 03 15:30:48 2017 +0530
@@ -307,13 +307,6 @@
                         if argidx is not None:
                             _ensureunicode(argidx)
 
-                # Bare open call (not an attribute on something else), the
-                # second argument (mode) must be a string, not bytes
-                elif fn == 'open' and not _isop(i - 1, '.'):
-                    arg1idx = _findargnofcall(1)
-                    if arg1idx is not None:
-                        _ensureunicode(arg1idx)
-
                 # It changes iteritems to items as iteritems is not
                 # present in Python 3 world.
                 elif fn == 'iteritems':
@@ -327,7 +320,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\x07'
+    BYTECODEHEADER = b'HG\x00\x08'
 
     class hgloader(importlib.machinery.SourceFileLoader):
         """Custom module loader that transforms source code.