# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 2016-10-07 13:29:57 # Node ID eaaedad68011e699b9dd341c4e57f15cd0bdbc8c # Parent 3139ec39b505134b8f142322bec20fb7a4b2173e py3: switch to .items() using transformer .iteritems() don't exist in Python 3 world. Used the transformer to replace .iteritems() to .items() diff --git a/mercurial/__init__.py b/mercurial/__init__.py --- a/mercurial/__init__.py +++ b/mercurial/__init__.py @@ -305,6 +305,13 @@ if sys.version_info[0] >= 3: except IndexError: pass + # It changes iteritems to items as iteritems is not + # present in Python 3 world. + if fn == 'iteritems': + yield tokenize.TokenInfo(t.type, 'items', + t.start, t.end, t.line) + continue + # Emit unmodified token. yield t @@ -312,7 +319,7 @@ if sys.version_info[0] >= 3: # ``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\x03' + BYTECODEHEADER = b'HG\x00\x04' class hgloader(importlib.machinery.SourceFileLoader): """Custom module loader that transforms source code.