Skip to content

Commit fa01ac0

Browse files
committed
ci: Fix Pylance warnings
1 parent 5f0d9e6 commit fa01ac0

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/griffe/_internal/agents/visitor.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,7 @@ def handle_attribute(
613613
self.extensions.call("on_attribute_node", node=node, agent=self)
614614
parent = self.current
615615
labels = set()
616+
names = None
616617

617618
if parent.kind is Kind.MODULE:
618619
try:
@@ -645,7 +646,9 @@ def handle_attribute(
645646
names = get_instance_names(node)
646647
except KeyError: # Unsupported nodes, like subscript.
647648
return
648-
parent = parent.parent # type: ignore[assignment]
649+
parent = parent.parent
650+
if parent is None:
651+
return
649652
labels.add("instance-attribute")
650653

651654
if not names:

0 commit comments

Comments
 (0)