Add support for Python 3.7 (#216)

* Add support for Python 3.7

* fixup! Add support for Python 3.7

* fixup! Add support for Python 3.7

* fixup! Add support for Python 3.7
This commit is contained in:
layday
2018-07-01 02:26:07 +03:00
committed by Samuel Colvin
parent d43ab483ee
commit 8f42e515d5
2 changed files with 11 additions and 2 deletions
+4
View File
@@ -3,6 +3,10 @@
History
-------
v0.11.1 (2018-07-01)
....................
* support Python 3.7
v0.11.0 (2018-06-28)
....................
* make ``list``, ``tuple`` and ``set`` types stricter #86
+7 -2
View File
@@ -3,7 +3,7 @@ from contextlib import contextmanager
from enum import Enum
from importlib import import_module
from textwrap import dedent
from typing import Tuple, _TypingBase
from typing import Tuple
from . import errors
@@ -12,6 +12,11 @@ try:
except ImportError:
email_validator = None
try:
from typing import _TypingBase as typing_base
except ImportError:
from typing import _Final as typing_base
PRETTY_REGEX = re.compile(r'([\w ]*?) *<(.*)> *')
@@ -117,7 +122,7 @@ def truncate(v, *, max_len=80):
def display_as_type(v):
if not isinstance(v, _TypingBase) and not isinstance(v, type):
if not isinstance(v, typing_base) and not isinstance(v, type):
v = type(v)
if isinstance(v, type) and issubclass(v, Enum):