contrib/byteify-strings.py
changeset 42700 f9b64ff9d26b
parent 42687 26a31c88e1a5
child 42701 11498aa91c03
equal deleted inserted replaced
42699:911e25dc9d8c 42700:f9b64ff9d26b
   150             coldelta = 0
   150             coldelta = 0
   151             coloffset = -1
   151             coloffset = -1
   152             if not insideignoreblock:
   152             if not insideignoreblock:
   153                 ignorenextline = (
   153                 ignorenextline = (
   154                     tokens[i - 1].type == token.COMMENT
   154                     tokens[i - 1].type == token.COMMENT
   155                     and tokens[i - 1].string == "#no-py3-transform"
   155                     and tokens[i - 1].string == "# no-py3-transform"
   156                 )
   156                 )
   157             continue
   157             continue
   158 
   158 
   159         if t.type == token.COMMENT:
   159         if t.type == token.COMMENT:
   160             if t.string == "#py3-transform: off":
   160             if t.string == "# py3-transform: off":
   161                 insideignoreblock = True
   161                 insideignoreblock = True
   162             if t.string == "#py3-transform: on":
   162             if t.string == "# py3-transform: on":
   163                 insideignoreblock = False
   163                 insideignoreblock = False
   164 
   164 
   165         if ignorenextline or insideignoreblock:
   165         if ignorenextline or insideignoreblock:
   166             yield adjusttokenpos(t, coloffset)
   166             yield adjusttokenpos(t, coloffset)
   167             continue
   167             continue