Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sphinx-doc/sphinx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2020-12-29 12:37:45 +0300
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2020-12-29 12:37:45 +0300
commita122397b4b5f5ab313f2e3fa28609aaf5cc79ab0 (patch)
treebb861d7b904d1cf678918b5c9d1ffcec2f4f86bc /sphinx/util
parentbac090cf40db31ddb74abb573fd3260af3d93734 (diff)
parent3f7bf48715ed5d6b0cf5d2645ee2886975b97b10 (diff)
Merge branch '3.x'
Diffstat (limited to 'sphinx/util')
-rw-r--r--sphinx/util/inspect.py1
-rw-r--r--sphinx/util/typing.py2
2 files changed, 3 insertions, 0 deletions
diff --git a/sphinx/util/inspect.py b/sphinx/util/inspect.py
index aa0d4aca6..8122654b3 100644
--- a/sphinx/util/inspect.py
+++ b/sphinx/util/inspect.py
@@ -187,6 +187,7 @@ def getslots(obj: Any) -> Optional[Dict]:
Return None if gienv *obj* does not have __slots__.
Raises AttributeError if given *obj* raises an error on accessing __slots__.
+ Raises TypeError if given *obj* is not a class.
Raises ValueError if given *obj* have invalid __slots__.
"""
if not inspect.isclass(obj):
diff --git a/sphinx/util/typing.py b/sphinx/util/typing.py
index 35f95140d..3c551a41f 100644
--- a/sphinx/util/typing.py
+++ b/sphinx/util/typing.py
@@ -150,6 +150,8 @@ def _restify_py37(cls: Optional["Type"]) -> str:
return ':obj:`%s`' % cls._name
else:
return ':obj:`%s.%s`' % (cls.__module__, cls._name)
+ elif isinstance(cls, ForwardRef):
+ return ':class:`%s`' % cls.__forward_arg__
else:
# not a class (ex. TypeVar)
return ':obj:`%s.%s`' % (cls.__module__, cls.__name__)