From 6be94e33028bbdb2e4ecfc2c4106df1214839b92 Mon Sep 17 00:00:00 2001 From: tserg <8017125+tserg@users.noreply.github.com> Date: Tue, 14 Nov 2023 11:25:31 +0800 Subject: [PATCH] fix lint --- tests/functional/syntax/test_unary.py | 5 ++--- vyper/builtins/functions.py | 8 ++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/functional/syntax/test_unary.py b/tests/functional/syntax/test_unary.py index 2b69f90023..c19e5ba5f0 100644 --- a/tests/functional/syntax/test_unary.py +++ b/tests/functional/syntax/test_unary.py @@ -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 = [ ( @@ -12,7 +11,7 @@ def foo() -> int128: return -2**127 """, InvalidType, - ), + ) ] diff --git a/vyper/builtins/functions.py b/vyper/builtins/functions.py index 2a7d997d59..0e8dc46446 100644 --- a/vyper/builtins/functions.py +++ b/vyper/builtins/functions.py @@ -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 @@ -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 @@ -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 (