mercurial/__init__.py
changeset 43089 c59eb1560c44
parent 43088 0d612db7047c
child 43090 1f339b503a40
equal deleted inserted replaced
43088:0d612db7047c 43089:c59eb1560c44
   169                     yield t
   169                     yield t
   170                     continue
   170                     continue
   171                 r, c = t.start
   171                 r, c = t.start
   172                 l = (
   172                 l = (
   173                     b'; from mercurial.pycompat import '
   173                     b'; from mercurial.pycompat import '
   174                     b'delattr, getattr\n'
   174                     b'delattr\n'
   175                 )
   175                 )
   176                 for u in tokenize.tokenize(io.BytesIO(l).readline):
   176                 for u in tokenize.tokenize(io.BytesIO(l).readline):
   177                     if u.type in (tokenize.ENCODING, token.ENDMARKER):
   177                     if u.type in (tokenize.ENCODING, token.ENDMARKER):
   178                         continue
   178                         continue
   179                     yield u._replace(
   179                     yield u._replace(
   218 
   218 
   219     # Header to add to bytecode files. This MUST be changed when
   219     # Header to add to bytecode files. This MUST be changed when
   220     # ``replacetoken`` or any mechanism that changes semantics of module
   220     # ``replacetoken`` or any mechanism that changes semantics of module
   221     # loading is changed. Otherwise cached bytecode may get loaded without
   221     # loading is changed. Otherwise cached bytecode may get loaded without
   222     # the new transformation mechanisms applied.
   222     # the new transformation mechanisms applied.
   223     BYTECODEHEADER = b'HG\x00\x10'
   223     BYTECODEHEADER = b'HG\x00\x11'
   224 
   224 
   225     class hgloader(importlib.machinery.SourceFileLoader):
   225     class hgloader(importlib.machinery.SourceFileLoader):
   226         """Custom module loader that transforms source code.
   226         """Custom module loader that transforms source code.
   227 
   227 
   228         When the source code is converted to a code object, we transform
   228         When the source code is converted to a code object, we transform