Commit 92788fef authored by isidentical's avatar isidentical
Browse files

pyparser: ensure all tokens are unique for type ignores

--HG--
branch : py3.8-isidentical-ast-feature-version
parent e30da78a4ef7
Pipeline #25179 failed with stage
in 13 minutes and 53 seconds
......@@ -214,7 +214,8 @@ class PythonParser(parser.Parser):
next_token_seen = token
# Special handling for TYPE_IGNOREs
if token.token_type == pygram.tokens.TYPE_IGNORE:
self.type_ignores.append(token)
if token not in self.type_ignores:
self.type_ignores.append(token)
elif self.add_token(token):
break
last_token_seen = token
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment