Skip to content

Commit

Permalink
Merge branch '4.5.x' into 4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
tk0miya committed Apr 16, 2022
2 parents b9d119d + e7cba35 commit 8d4d47f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sphinx/util/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ def _restify_py37(cls: Optional[Type], mode: str = 'fully-qualified-except-typin
return text
elif isinstance(cls, typing._SpecialForm):
return ':py:obj:`~%s.%s`' % (cls.__module__, cls._name)
elif sys.version_info >= (3, 11) and cls is typing.Any:
# handle bpo-46998
return f':py:obj:`~{cls.__module__}.{cls.__name__}`'
elif hasattr(cls, '__qualname__'):
if cls.__module__ == 'typing':
return ':py:class:`~%s.%s`' % (cls.__module__, cls.__qualname__)
Expand Down

0 comments on commit 8d4d47f

Please sign in to comment.