# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1488535248 -19800 # Node ID 7c54917b31f6200449bb7afd253ca0561288456a # Parent 76a64c1e5439a42d8bc0857c875ddc0714e1702a 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. diff -r 76a64c1e5439 -r 7c54917b31f6 mercurial/__init__.py --- 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.