summaryrefslogtreecommitdiff
path: root/sphinx/directives/other.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2018-12-08 15:58:57 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2018-12-08 15:59:02 +0900
commitbc081e44f8b438fa1e02b17bf6c4f4ea9c91126c (patch)
treee6c6ef4c1dbe8781b89abf7d399e67a3f9b493b3 /sphinx/directives/other.py
parent559c8202146eb4682d3babb648a4aa5b6c588977 (diff)
downloadsphinx-git-bc081e44f8b438fa1e02b17bf6c4f4ea9c91126c.tar.gz
Fix annotations
Diffstat (limited to 'sphinx/directives/other.py')
-rw-r--r--sphinx/directives/other.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/sphinx/directives/other.py b/sphinx/directives/other.py
index cc76275b9..f5c0cccda 100644
--- a/sphinx/directives/other.py
+++ b/sphinx/directives/other.py
@@ -8,6 +8,7 @@
"""
import re
+from typing import cast
from docutils import nodes
from docutils.parsers.rst import directives
@@ -365,7 +366,7 @@ class Only(SphinxDirective):
# Use these depths to determine where the nested sections should
# be placed in the doctree.
n_sects_to_raise = current_depth - nested_depth + 1
- parent = self.state.parent
+ parent = cast(nodes.Element, self.state.parent)
for i in range(n_sects_to_raise):
if parent.parent:
parent = parent.parent