Skip to content

Commit

Permalink
Fix crash in c-extension-no-member check
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtylerwalls committed Apr 8, 2022
1 parent f139ec5 commit ee94d81
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ Release date: TBA

Closes #1555

* Fix crash (in unreleased development) in ``c-extension-no-member`` check when inspecting living objects
with ``extension-pkg-allow-list``.

Closes #6221

* The concept of checker priority has been removed.

* ``duplicate-argument-name`` now only raises once for each set of duplicated arguments.
Expand Down
4 changes: 4 additions & 0 deletions pylint/checkers/typecheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -1053,6 +1053,10 @@ def visit_attribute(self, node: nodes.Attribute) -> None:
missingattr.add((owner, name))
continue
else:
if isinstance(attr_nodes, nodes.NodeNG):
# If owner was a living object, attr_nodes might be a node itself
# Faster than retrieving the module object and testing _is_c_extension()
break
for attr_node in attr_nodes:
attr_parent = attr_node.parent
# Skip augmented assignments
Expand Down

0 comments on commit ee94d81

Please sign in to comment.