Skip to content

Commit 923a9d2

Browse files
committed
fix: derive annotation for TypeAliasForwardRef from its name attribute
TypeAliasForwardRef.__repr__ was changed in sphinx v8.2.0 to not only yield the name, but also the class name.
1 parent 3857021 commit 923a9d2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/sphinx_autodoc_typehints/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ def format_annotation(annotation: Any, config: Config) -> str: # noqa: C901, PL
222222
return format_internal_tuple(annotation, config)
223223

224224
if isinstance(annotation, TypeAliasForwardRef):
225-
return str(annotation)
225+
return annotation.name
226226

227227
try:
228228
module = get_annotation_module(annotation)

0 commit comments

Comments
 (0)