Skip to content

Commit

Permalink
Fix sphinx-doc#9490: autodoc: Some typing.* objects are broken
Browse files Browse the repository at this point in the history
At the HEAD of 3.10, the implementation of `typing._SpecialForm` and
`typing._BaseGenericAlias` has been changed to support __qualname__.
  • Loading branch information
tk0miya committed Jul 22, 2021
1 parent 771507e commit b51c5bb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES
Expand Up @@ -21,6 +21,8 @@ Bugs fixed

* #9489: autodoc: Custom types using ``typing.NewType`` are not displayed well
with the HEAD of 3.10
* #9490: autodoc: Some objects under ``typing`` module are not displayed well
with the HEAD of 3.10
* #9435: linkcheck: Failed to check anchors in github.com

Testing
Expand Down
2 changes: 1 addition & 1 deletion sphinx/util/typing.py
Expand Up @@ -309,7 +309,7 @@ def stringify(annotation: Any) -> str:
elif annotation in INVALID_BUILTIN_CLASSES:
return INVALID_BUILTIN_CLASSES[annotation]
elif (getattr(annotation, '__module__', None) == 'builtins' and
hasattr(annotation, '__qualname__')):
getattr(annotation, '__qualname__', None)):
return annotation.__qualname__
elif annotation is Ellipsis:
return '...'
Expand Down

0 comments on commit b51c5bb

Please sign in to comment.