Skip to content

Commit

Permalink
chore: loosen dependency on asttokens (#3149)
Browse files Browse the repository at this point in the history
  • Loading branch information
ozmium22 authored Nov 14, 2022
1 parent 886488f commit 46b6cfe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def _global_version(version):
python_requires=">=3.7,<3.11",
py_modules=["vyper"],
install_requires=[
"asttokens==2.0.5",
"asttokens>=2.0.5,<3",
"pycryptodome>=3.5.1,<4",
"semantic-version>=2.10,<3",
"cached-property==1.5.2 ; python_version<'3.8'",
Expand Down
4 changes: 2 additions & 2 deletions vyper/ast/annotation.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ast as python_ast
import tokenize
from decimal import Decimal
from typing import Optional
from typing import Optional, cast

import asttokens

Expand Down Expand Up @@ -274,7 +274,7 @@ def annotate_python_ast(
The annotated and optimized AST.
"""

tokens = asttokens.ASTTokens(source_code, tree=parsed_ast)
tokens = asttokens.ASTTokens(source_code, tree=cast(Optional[python_ast.Module], parsed_ast))
visitor = AnnotatingVisitor(source_code, modification_offsets, tokens, source_id, contract_name)
visitor.visit(parsed_ast)

Expand Down

0 comments on commit 46b6cfe

Please sign in to comment.