File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ Features added
1616Bugs fixed
1717----------
1818
19+ * #9504: autodoc: generate incorrect reference to the parent class if the target
20+ class inherites the class having ``_name`` attribute
1921* #9512: sphinx-build: crashed with the HEAD of Python 3.10
2022
2123Testing
Original file line number Diff line number Diff line change @@ -171,12 +171,8 @@ def _restify_py37(cls: Optional[Type]) -> str:
171171 text += r"\ [%s]" % ", " .join (restify (a ) for a in cls .__args__ )
172172
173173 return text
174- elif hasattr (cls , '_name' ):
175- # SpecialForm
176- if cls .__module__ == 'typing' :
177- return ':obj:`~%s.%s`' % (cls .__module__ , cls ._name )
178- else :
179- return ':obj:`%s.%s`' % (cls .__module__ , cls ._name )
174+ elif isinstance (cls , typing ._SpecialForm ):
175+ return ':obj:`~%s.%s`' % (cls .__module__ , cls ._name )
180176 elif hasattr (cls , '__qualname__' ):
181177 if cls .__module__ == 'typing' :
182178 return ':class:`~%s.%s`' % (cls .__module__ , cls .__qualname__ )
You can’t perform that action at this time.
0 commit comments