##// END OF EJS Templates
py3: switch to .items() using transformer...
Pulkit Goyal -
r30052:eaaedad6 default
parent child Browse files
Show More
@@ -305,6 +305,13 b' if sys.version_info[0] >= 3:'
305 except IndexError:
305 except IndexError:
306 pass
306 pass
307
307
308 # It changes iteritems to items as iteritems is not
309 # present in Python 3 world.
310 if fn == 'iteritems':
311 yield tokenize.TokenInfo(t.type, 'items',
312 t.start, t.end, t.line)
313 continue
314
308 # Emit unmodified token.
315 # Emit unmodified token.
309 yield t
316 yield t
310
317
@@ -312,7 +319,7 b' if sys.version_info[0] >= 3:'
312 # ``replacetoken`` or any mechanism that changes semantics of module
319 # ``replacetoken`` or any mechanism that changes semantics of module
313 # loading is changed. Otherwise cached bytecode may get loaded without
320 # loading is changed. Otherwise cached bytecode may get loaded without
314 # the new transformation mechanisms applied.
321 # the new transformation mechanisms applied.
315 BYTECODEHEADER = b'HG\x00\x03'
322 BYTECODEHEADER = b'HG\x00\x04'
316
323
317 class hgloader(importlib.machinery.SourceFileLoader):
324 class hgloader(importlib.machinery.SourceFileLoader):
318 """Custom module loader that transforms source code.
325 """Custom module loader that transforms source code.
General Comments 0
You need to be logged in to leave comments. Login now