Show More
@@ -152,14 +152,14 b' def replacetokens(tokens, opts):' | |||||
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: |
@@ -152,33 +152,33 b' Test without attr*() as methods' | |||||
152 | Test ignore comments |
|
152 | Test ignore comments | |
153 |
|
153 | |||
154 | $ cat > testfile.py <<EOF |
|
154 | $ cat > testfile.py <<EOF | |
155 | > #py3-transform: off |
|
155 | > # py3-transform: off | |
156 | > "none" |
|
156 | > "none" | |
157 | > "of" |
|
157 | > "of" | |
158 | > 'these' |
|
158 | > 'these' | |
159 | > s = """should""" |
|
159 | > s = """should""" | |
160 | > d = '''be''' |
|
160 | > d = '''be''' | |
161 | > #py3-transform: on |
|
161 | > # py3-transform: on | |
162 | > "this should" |
|
162 | > "this should" | |
163 | > 'and this also' |
|
163 | > 'and this also' | |
164 | > |
|
164 | > | |
165 | > #no-py3-transform |
|
165 | > # no-py3-transform | |
166 | > l = "this should be ignored" |
|
166 | > l = "this should be ignored" | |
167 | > l2 = "this shouldn't" |
|
167 | > l2 = "this shouldn't" | |
168 | > |
|
168 | > | |
169 | > EOF |
|
169 | > EOF | |
170 | $ byteify_strings testfile.py |
|
170 | $ byteify_strings testfile.py | |
171 | #py3-transform: off |
|
171 | # py3-transform: off | |
172 | "none" |
|
172 | "none" | |
173 | "of" |
|
173 | "of" | |
174 | 'these' |
|
174 | 'these' | |
175 | s = """should""" |
|
175 | s = """should""" | |
176 | d = '''be''' |
|
176 | d = '''be''' | |
177 | #py3-transform: on |
|
177 | # py3-transform: on | |
178 | b"this should" |
|
178 | b"this should" | |
179 | b'and this also' |
|
179 | b'and this also' | |
180 |
|
180 | |||
181 | #no-py3-transform |
|
181 | # no-py3-transform | |
182 | l = "this should be ignored" |
|
182 | l = "this should be ignored" | |
183 | l2 = b"this shouldn't" |
|
183 | l2 = b"this shouldn't" | |
184 |
|
184 |
General Comments 0
You need to be logged in to leave comments.
Login now