Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
tserg committed Nov 14, 2023
1 parent bbf0510 commit 6be94e3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions tests/functional/syntax/test_unary.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import pytest

from vyper.compiler import compile_code
from vyper.exceptions import InvalidType, TypeMismatch

from vyper.exceptions import InvalidType

fail_list = [
(
Expand All @@ -12,7 +11,7 @@ def foo() -> int128:
return -2**127
""",
InvalidType,
),
)
]


Expand Down
8 changes: 4 additions & 4 deletions vyper/builtins/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1514,9 +1514,9 @@ def prefold(self, node):

validate_call_args(node, 2)
args = [i._metadata.get("folded_value") for i in node.args]
if [i for i in node.args if not isinstance(i, vy_ast.Int)]:
if [i for i in args if not isinstance(i, vy_ast.Int)]:
raise UnfoldableNode
value, shift = [i.value for i in node.args]
value, shift = [i.value for i in args]
if shift < -256 or shift > 256:
# this validation is performed to prevent the compiler from hanging
# rather than for correctness because the post-folded constant would
Expand All @@ -1530,7 +1530,7 @@ def prefold(self, node):
return vy_ast.Int.from_node(node, value=value)

def evaluate(self, node):
value = args[0]._metadata.get("folded_value")
value = node.args[0]._metadata.get("folded_value")
if not isinstance(value, vy_ast.Int):
raise UnfoldableNode

Expand Down Expand Up @@ -2107,7 +2107,7 @@ def prefold(self, node):

def evaluate(self, node):
new_node = self.prefold(node)

left = node.args[0]._metadata.get("folded_value")
right = node.args[1]._metadata.get("folded_value")
if isinstance(left.value, Decimal) and (
Expand Down

0 comments on commit 6be94e3

Please sign in to comment.