Skip to content

Commit

Permalink
Fix sphinx-doc#9194: autodoc: Literal type in signature is not hyperl…
Browse files Browse the repository at this point in the history
…inked
  • Loading branch information
tk0miya committed Dec 19, 2021
1 parent 8becfb8 commit e8caf9d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES
Expand Up @@ -43,6 +43,7 @@ Bugs fixed
with Python 3.10
* #9968: autodoc: instance variables are not shown if __init__ method has
position-only-arguments
* #9194: autodoc: Literal type in signature is not hyperlinked
* #9947: i18n: topic directive having a bullet list can't be translatable
* #9878: mathjax: MathJax configuration is placed after loading MathJax itself
* #9857: Generated RFC links use outdated base url
Expand Down
2 changes: 1 addition & 1 deletion sphinx/domains/python.py
Expand Up @@ -83,7 +83,7 @@ class ModuleEntry(NamedTuple):
def type_to_xref(target: str, env: BuildEnvironment = None, suppress_prefix: bool = False
) -> addnodes.pending_xref:
"""Convert a type string to a cross reference node."""
if target == 'None':
if target in ('None', 'typing.Literal'):
reftype = 'obj'
else:
reftype = 'class'
Expand Down

0 comments on commit e8caf9d

Please sign in to comment.