diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-07-03 19:29:24 +0300 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-07-06 08:38:56 +0300 |
commit | 1c6a279fa81f27bcc469f988bcc20323e120e295 (patch) | |
tree | 900feb756bee50a3954fe6acbb6d7b2e3045ef9a /sphinx/testing | |
parent | 3f6565df6323534e69d797003d8cb20e99c2c255 (diff) |
Migrate to py3 style type annotation: sphinx.testing.restructuredtext
Diffstat (limited to 'sphinx/testing')
-rw-r--r-- | sphinx/testing/restructuredtext.py | 11 |
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 |