Skip to content

Commit

Permalink
Use safer version of mro (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
felix-hilden committed Mar 14, 2024
1 parent 35fefe2 commit 85f436f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/src/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ sphinx-codeautolink adheres to
Unreleased
----------
- Fix linking blocks with line numbers (:issue:`137`)
- Use safer version of ``mro`` to support ``type`` (:issue:`120`)

0.15.0 (2023-02-05)
-------------------
Expand Down
2 changes: 1 addition & 1 deletion src/sphinx_codeautolink/extension/resolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def locate_type(cursor: Cursor, components: Tuple[str, ...], inventory) -> Curso
pass

if isclass(previous.value) and cursor.location not in inventory:
for val in previous.value.mro():
for val in previous.value.__mro__:
name = fully_qualified_name(val)
if name + "." + component in inventory:
previous.location = name
Expand Down

0 comments on commit 85f436f

Please sign in to comment.