diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2018-11-24 20:14:43 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2018-11-24 23:19:51 +0900 |
commit | 3c99d0060557bb33a482f3fe74c1b665fb3de010 (patch) | |
tree | 756aecf0bcb307e553f3903ee5bd9ff9b32d44f1 /sphinx/pycode | |
parent | 95dffb2af6fbdefe30f1b492adedc4036abd6f84 (diff) | |
download | sphinx-git-3c99d0060557bb33a482f3fe74c1b665fb3de010.tar.gz |
Add sphinx.util.typing:unicode to help mypy-3 migration
Diffstat (limited to 'sphinx/pycode')
-rw-r--r-- | sphinx/pycode/__init__.py | 1 | ||||
-rw-r--r-- | sphinx/pycode/parser.py | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/sphinx/pycode/__init__.py b/sphinx/pycode/__init__.py index 3bd49a305..fe6b5f7e1 100644 --- a/sphinx/pycode/__init__.py +++ b/sphinx/pycode/__init__.py @@ -23,6 +23,7 @@ from sphinx.util import get_module_source, detect_encoding if False: # For type annotation from typing import Any, Dict, IO, List, Tuple # NOQA + from sphinx.util.typing import unicode # NOQA class ModuleAnalyzer: diff --git a/sphinx/pycode/parser.py b/sphinx/pycode/parser.py index e1aa1f504..9b2665082 100644 --- a/sphinx/pycode/parser.py +++ b/sphinx/pycode/parser.py @@ -22,6 +22,7 @@ from six import text_type if False: # For type annotation from typing import Any, Dict, IO, List, Tuple # NOQA + from sphinx.util.typing import unicode # NOQA comment_re = re.compile(u'^\\s*#: ?(.*)\r?\n?$') indent_re = re.compile(u'^\\s*$') @@ -143,7 +144,7 @@ class TokenProcessor: # type: (List[unicode]) -> None lines = iter(buffers) self.buffers = buffers - self.tokens = tokenize.generate_tokens(lambda: next(lines)) # type: ignore # NOQA + self.tokens = tokenize.generate_tokens(lambda: next(lines)) # type: ignore self.current = None # type: Token self.previous = None # type: Token |