Skip to content

Commit

Permalink
Fix sphinx-doc#7119: autodoc: Broken doctree was generated by builtin…
Browse files Browse the repository at this point in the history
…_resolver

The builtin_resolver() generates broken doctree unexpectedly if it
contains pending_xref_condition nodes.
  • Loading branch information
tk0miya committed Mar 13, 2021
1 parent ae413e9 commit 6c7480b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sphinx/domains/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -1301,6 +1301,10 @@ def istyping(s: str) -> bool:

return s in typing.__all__ # type: ignore

content = find_pending_xref_condition(node, 'resolved')
if content:
contnode = content.children[0]

if node.get('refdomain') != 'py':
return None
elif node.get('reftype') in ('class', 'obj') and node.get('reftarget') == 'None':
Expand Down

0 comments on commit 6c7480b

Please sign in to comment.