##// END OF EJS Templates
byteify-strings: add space in special comments to silence flake8 error...
Raphaël Gomès -
r42928:f9b64ff9 default
parent child Browse files
Show More
@@ -152,14 +152,14 b' def replacetokens(tokens, opts):'
152 152 if not insideignoreblock:
153 153 ignorenextline = (
154 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 157 continue
158 158
159 159 if t.type == token.COMMENT:
160 if t.string == "#py3-transform: off":
160 if t.string == "# py3-transform: off":
161 161 insideignoreblock = True
162 if t.string == "#py3-transform: on":
162 if t.string == "# py3-transform: on":
163 163 insideignoreblock = False
164 164
165 165 if ignorenextline or insideignoreblock:
@@ -152,33 +152,33 b' Test without attr*() as methods'
152 152 Test ignore comments
153 153
154 154 $ cat > testfile.py <<EOF
155 > #py3-transform: off
155 > # py3-transform: off
156 156 > "none"
157 157 > "of"
158 158 > 'these'
159 159 > s = """should"""
160 160 > d = '''be'''
161 > #py3-transform: on
161 > # py3-transform: on
162 162 > "this should"
163 163 > 'and this also'
164 164 >
165 > #no-py3-transform
165 > # no-py3-transform
166 166 > l = "this should be ignored"
167 167 > l2 = "this shouldn't"
168 168 >
169 169 > EOF
170 170 $ byteify_strings testfile.py
171 #py3-transform: off
171 # py3-transform: off
172 172 "none"
173 173 "of"
174 174 'these'
175 175 s = """should"""
176 176 d = '''be'''
177 #py3-transform: on
177 # py3-transform: on
178 178 b"this should"
179 179 b'and this also'
180 180
181 #no-py3-transform
181 # no-py3-transform
182 182 l = "this should be ignored"
183 183 l2 = b"this shouldn't"
184 184
General Comments 0
You need to be logged in to leave comments. Login now