Skip to content

Commit

Permalink
fix node_id check
Browse files Browse the repository at this point in the history
node_id is not generated for ast nodes generated manually (like those in
vyper.ast.expansion)
  • Loading branch information
charles-cooper committed Jul 25, 2023
1 parent c02951a commit 4a7314c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vyper/ast/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 4a7314c

Please sign in to comment.