Skip to content

Commit

Permalink
Fix AST traversal in docs for Astroid v3
Browse files Browse the repository at this point in the history
Changelog: !minor
  • Loading branch information
GeeTransit committed Feb 29, 2024
1 parent 68a2dac commit f36d5e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/_extensions/autoapi_literal_annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def _patched_resolve_annotation(annotation):
if isinstance(annotation, astroid.Subscript):
value = old_resolve_annotation(annotation.value)
slice_node = annotation.slice
if isinstance(slice_node, astroid.Index):
if hasattr(astroid, "Index") and isinstance(slice_node, astroid.Index):
slice_node = slice_node.value
if value == "Literal":
if isinstance(slice_node, astroid.Tuple):
Expand Down

0 comments on commit f36d5e5

Please sign in to comment.