diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2018-12-16 00:32:10 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-16 00:32:10 +0900 |
commit | c70e65fc6cd04d02df4f7911025f534dbd27cc20 (patch) | |
tree | 1e8614ac5516dace99ef1df4d203081662c7c2d6 /sphinx/io.py | |
parent | d6d4406ce987cc8823d1b3a33be3a418bcd2a59d (diff) | |
parent | 79eec90f36f5a74e24cfd6740126396fd6567e07 (diff) | |
download | sphinx-git-c70e65fc6cd04d02df4f7911025f534dbd27cc20.tar.gz |
Merge branch 'master' into 5770_doctest_refers_highlight_language
Diffstat (limited to 'sphinx/io.py')
-rw-r--r-- | sphinx/io.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/sphinx/io.py b/sphinx/io.py index b4a99fe41..d405081b1 100644 --- a/sphinx/io.py +++ b/sphinx/io.py @@ -48,7 +48,6 @@ if False: from sphinx.application import Sphinx # NOQA from sphinx.builders import Builder # NOQA from sphinx.environment import BuildEnvironment # NOQA - from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) @@ -170,7 +169,7 @@ class SphinxBaseFileInput(FileInput): super(SphinxBaseFileInput, self).__init__(*args, **kwds) def read(self): - # type: () -> unicode + # type: () -> str """Reads the contents from file. After reading, it emits Sphinx event ``source-read``. @@ -213,7 +212,7 @@ class SphinxRSTFileInput(SphinxBaseFileInput): supported = ('restructuredtext',) def prepend_prolog(self, text, prolog): - # type: (StringList, unicode) -> None + # type: (StringList, str) -> None docinfo = self.count_docinfo_lines(text) if docinfo: # insert a blank line after docinfo @@ -227,7 +226,7 @@ class SphinxRSTFileInput(SphinxBaseFileInput): text.insert(docinfo + lineno + 1, '', '<generated>', 0) def append_epilog(self, text, epilog): - # type: (StringList, unicode) -> None + # type: (StringList, str) -> None # append a blank line and rst_epilog text.append('', '<generated>', 0) for lineno, line in enumerate(epilog.splitlines()): @@ -265,7 +264,7 @@ class FiletypeNotFoundError(Exception): def get_filetype(source_suffix, filename): - # type: (Dict[unicode, unicode], unicode) -> unicode + # type: (Dict[str, str], str) -> str for suffix, filetype in source_suffix.items(): if filename.endswith(suffix): # If default filetype (None), considered as restructuredtext. @@ -275,7 +274,7 @@ def get_filetype(source_suffix, filename): def read_doc(app, env, filename): - # type: (Sphinx, BuildEnvironment, unicode) -> nodes.document + # type: (Sphinx, BuildEnvironment, str) -> nodes.document """Parse a document and convert to doctree.""" # set up error_handler for the target document error_handler = UnicodeDecodeErrorHandler(env.docname) @@ -307,7 +306,7 @@ def read_doc(app, env, filename): def setup(app): - # type: (Sphinx) -> Dict[unicode, Any] + # type: (Sphinx) -> Dict[str, Any] app.registry.add_source_input(SphinxFileInput) return { |