diff --git a/contrib/byteify-strings.py b/contrib/byteify-strings.py --- a/contrib/byteify-strings.py +++ b/contrib/byteify-strings.py @@ -152,14 +152,14 @@ def replacetokens(tokens, opts): if not insideignoreblock: ignorenextline = ( tokens[i - 1].type == token.COMMENT - and tokens[i - 1].string == "#no-py3-transform" + and tokens[i - 1].string == "# no-py3-transform" ) continue if t.type == token.COMMENT: - if t.string == "#py3-transform: off": + if t.string == "# py3-transform: off": insideignoreblock = True - if t.string == "#py3-transform: on": + if t.string == "# py3-transform: on": insideignoreblock = False if ignorenextline or insideignoreblock: diff --git a/tests/test-byteify-strings.t b/tests/test-byteify-strings.t --- a/tests/test-byteify-strings.t +++ b/tests/test-byteify-strings.t @@ -152,33 +152,33 @@ Test without attr*() as methods Test ignore comments $ cat > testfile.py < #py3-transform: off + > # py3-transform: off > "none" > "of" > 'these' > s = """should""" > d = '''be''' - > #py3-transform: on + > # py3-transform: on > "this should" > 'and this also' > - > #no-py3-transform + > # no-py3-transform > l = "this should be ignored" > l2 = "this shouldn't" > > EOF $ byteify_strings testfile.py - #py3-transform: off + # py3-transform: off "none" "of" 'these' s = """should""" d = '''be''' - #py3-transform: on + # py3-transform: on b"this should" b'and this also' - #no-py3-transform + # no-py3-transform l = "this should be ignored" l2 = b"this shouldn't"