[PATCH 2 of 2] py3: drop unrequired code from __init__.py
Pulkit Goyal
7895pulkit at gmail.com
Fri Mar 3 05:04:12 EST 2017
# HG changeset patch
# User Pulkit Goyal <7895pulkit at gmail.com>
# Date 1488535248 -19800
# Fri Mar 03 15:30:48 2017 +0530
# Node ID 98bce3791615aef68f939a14ed82eae64793693c
# Parent e815f7c4026f7e714b6e9bb59dce90020d9c56f2
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 e815f7c4026f -r 98bce3791615 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.
More information about the Mercurial-devel
mailing list