mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix annotations
This commit is contained in:
parent
7a0e205ebd
commit
8cba23b8c1
@ -48,7 +48,7 @@ class _TranslationProxy(UserString):
|
|||||||
return object.__new__(cls)
|
return object.__new__(cls)
|
||||||
|
|
||||||
def __getnewargs__(self):
|
def __getnewargs__(self):
|
||||||
# type: () -> Tuple
|
# type: () -> Tuple[str]
|
||||||
return (self._func,) + self._args # type: ignore
|
return (self._func,) + self._args # type: ignore
|
||||||
|
|
||||||
def __init__(self, func, *args):
|
def __init__(self, func, *args):
|
||||||
|
@ -75,7 +75,7 @@ class NestedInlineTransform:
|
|||||||
if matcher(subnode):
|
if matcher(subnode):
|
||||||
node.parent.insert(pos + 1, subnode)
|
node.parent.insert(pos + 1, subnode)
|
||||||
else:
|
else:
|
||||||
newnode = node.__class__('', subnode, **node.attributes)
|
newnode = node.__class__('', '', subnode, **node.attributes)
|
||||||
node.parent.insert(pos + 1, newnode)
|
node.parent.insert(pos + 1, newnode)
|
||||||
|
|
||||||
|
|
||||||
|
@ -95,11 +95,12 @@ def find_subsections(section):
|
|||||||
# type: (nodes.Element) -> List[nodes.section]
|
# type: (nodes.Element) -> List[nodes.section]
|
||||||
"""Return a list of subsections for the given ``section``."""
|
"""Return a list of subsections for the given ``section``."""
|
||||||
result = []
|
result = []
|
||||||
for child in section.children:
|
for child in section:
|
||||||
if isinstance(child, nodes.section):
|
if isinstance(child, nodes.section):
|
||||||
result.append(child)
|
result.append(child)
|
||||||
continue
|
continue
|
||||||
result.extend(find_subsections(child))
|
elif isinstance(child, nodes.Element):
|
||||||
|
result.extend(find_subsections(child))
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user