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/util/typing.py | |
parent | 95dffb2af6fbdefe30f1b492adedc4036abd6f84 (diff) | |
download | sphinx-git-3c99d0060557bb33a482f3fe74c1b665fb3de010.tar.gz |
Add sphinx.util.typing:unicode to help mypy-3 migration
Diffstat (limited to 'sphinx/util/typing.py')
-rw-r--r-- | sphinx/util/typing.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sphinx/util/typing.py b/sphinx/util/typing.py index 2cacc7785..2ac03c916 100644 --- a/sphinx/util/typing.py +++ b/sphinx/util/typing.py @@ -13,7 +13,15 @@ from typing import Callable, Dict, List, Tuple from docutils import nodes from docutils.parsers.rst.states import Inliner -from six import text_type +from six import PY2, text_type + + +# a typedef for unicode to make migration to mypy-py3 mode easy +# Note: It will be removed after migrated (soon). +if PY2: + unicode = text_type +else: + unicode = str # common role functions |