mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-10-26 07:00:14 -05:00
Fix #7461: py domain: fails with IndexError for empty tuple in type annotation
This commit is contained in:
1 parent
d8704c4f58
commit
2e219366c4
3 files changed
+19
-5
No files matched your search
@@ -255,6 +255,13 @@ def test_parse_annotation():
|
||||
[pending_xref, "int"],
|
||||
[desc_sig_punctuation, "]"]))
|
||||
|
||||
doctree = _parse_annotation("Tuple[()]")
|
||||
assert_node(doctree, ([pending_xref, "Tuple"],
|
||||
[desc_sig_punctuation, "["],
|
||||
[desc_sig_punctuation, "("],
|
||||
[desc_sig_punctuation, ")"],
|
||||
[desc_sig_punctuation, "]"]))
|
||||
|
||||
doctree = _parse_annotation("Callable[[int, int], int]")
|
||||
assert_node(doctree, ([pending_xref, "Callable"],
|
||||
[desc_sig_punctuation, "["],
|
||||
|
||||
Reference in new issue
Block a user