From 4a7314c5972cd72f65c65d9fbe6c52760f22805b Mon Sep 17 00:00:00 2001 From: Charles Cooper Date: Tue, 25 Jul 2023 15:47:53 -0700 Subject: [PATCH] fix node_id check node_id is not generated for ast nodes generated manually (like those in vyper.ast.expansion) --- vyper/ast/nodes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vyper/ast/nodes.py b/vyper/ast/nodes.py index 7c907b4d08..2497928035 100644 --- a/vyper/ast/nodes.py +++ b/vyper/ast/nodes.py @@ -339,7 +339,7 @@ def __hash__(self): def __eq__(self, other): if not isinstance(other, type(self)): return False - if other.node_id != self.node_id: + if getattr(other, "node_id", None) != getattr(self, "node_id", None): return False for field_name in (i for i in self.get_fields() if i not in VyperNode.__slots__): if getattr(self, field_name, None) != getattr(other, field_name, None):