Mercurial > public > mercurial-scm > hg
comparison contrib/byteify-strings.py @ 42700:f9b64ff9d26b
byteify-strings: add space in special comments to silence flake8 error
This is done soon enough that nobody has had the time to use this feature yet.
author | Rapha?l Gom?s <rgomes@octobus.net> |
---|---|
date | Tue, 06 Aug 2019 14:49:30 +0200 |
parents | 26a31c88e1a5 |
children | 11498aa91c03 |
comparison
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 |