Skip to content

Commit

Permalink
Update src/typeguard/_transformer.py
Browse files Browse the repository at this point in the history
  • Loading branch information
agronholm authored Aug 26, 2023
1 parent dcaed15 commit 945ddf4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/typeguard/_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ def generic_visit(self, node: AST) -> AST:

# Add `pass` to list fields that were optimised away
for field_name in non_empty_list_fields:
if not hasattr(node, field_name) or not getattr(node, field_name):
if not getattr(node, field_name, None):
setattr(node, field_name, [Pass()])

return node
Expand Down

0 comments on commit 945ddf4

Please sign in to comment.