summaryrefslogtreecommitdiff
path: root/sphinx/directives/code.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2021-03-23 01:44:24 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2021-03-23 01:44:24 +0900
commit555a52be82be3578470179f9047ed6abb943057e (patch)
treec183fe533c22ea67f95df65e0548c6a85b06e016 /sphinx/directives/code.py
parent09a037006c71f26bfde7b8ef1940f0a38e0cef86 (diff)
downloadsphinx-git-555a52be82be3578470179f9047ed6abb943057e.tar.gz
refactor: Use PEP-526 based variable annotation (sphinx.directives)
Diffstat (limited to 'sphinx/directives/code.py')
-rw-r--r--sphinx/directives/code.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/sphinx/directives/code.py b/sphinx/directives/code.py
index 04b81cef5..12ab51c58 100644
--- a/sphinx/directives/code.py
+++ b/sphinx/directives/code.py
@@ -142,7 +142,7 @@ class CodeBlock(SphinxDirective):
lines = dedent_lines(lines, self.options['dedent'], location=location)
code = '\n'.join(lines)
- literal = nodes.literal_block(code, code) # type: Element
+ literal: Element = nodes.literal_block(code, code)
if 'linenos' in self.options or 'lineno-start' in self.options:
literal['linenos'] = True
literal['classes'] += self.options.get('class', [])
@@ -422,7 +422,7 @@ class LiteralInclude(SphinxDirective):
reader = LiteralIncludeReader(filename, self.options, self.config)
text, lines = reader.read(location=location)
- retnode = nodes.literal_block(text, text, source=filename) # type: Element
+ retnode: Element = nodes.literal_block(text, text, source=filename)
retnode['force'] = 'force' in self.options
self.set_source_info(retnode)
if self.options.get('diff'): # if diff is set, set udiff