Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sphinx-doc/sphinx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2019-07-03 19:29:24 +0300
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2019-07-06 08:38:56 +0300
commit1c6a279fa81f27bcc469f988bcc20323e120e295 (patch)
tree900feb756bee50a3954fe6acbb6d7b2e3045ef9a /sphinx/testing
parent3f6565df6323534e69d797003d8cb20e99c2c255 (diff)
Migrate to py3 style type annotation: sphinx.testing.restructuredtext
Diffstat (limited to 'sphinx/testing')
-rw-r--r--sphinx/testing/restructuredtext.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/sphinx/testing/restructuredtext.py b/sphinx/testing/restructuredtext.py
index 8bf1c041e..1da8d9a60 100644
--- a/sphinx/testing/restructuredtext.py
+++ b/sphinx/testing/restructuredtext.py
@@ -8,21 +8,16 @@
from os import path
+from docutils import nodes
from docutils.core import publish_doctree
+from sphinx.application import Sphinx
from sphinx.io import SphinxStandaloneReader
from sphinx.parsers import RSTParser
from sphinx.util.docutils import sphinx_domains
-if False:
- # For type annotation
- from docutils import nodes # NOQA
- from sphinx.application import Sphinx # NOQA
-
-
-def parse(app, text, docname='index'):
- # type: (Sphinx, str, str) -> nodes.document
+def parse(app: Sphinx, text: str, docname: str = 'index') -> nodes.document:
"""Parse a string as reStructuredText with Sphinx application."""
try:
app.env.temp_data['docname'] = docname