Add Windows conda-less support

This commit is contained in:
allegroai 2019-06-14 15:09:23 +03:00
parent e24abf2153
commit 60b2246966
2 changed files with 16 additions and 2 deletions

View File

@ -1,9 +1,16 @@
import base64 import base64
from distutils.util import strtobool from distutils.util import strtobool
from typing import Union, Optional, Text, Any, TypeVar, Callable, Tuple from typing import Union, Optional, Any, TypeVar, Callable, Tuple
import six import six
try:
from typing import Text
except ImportError:
# windows conda-less hack
Text = Any
ConverterType = TypeVar("ConverterType", bound=Callable[[Any], Any]) ConverterType = TypeVar("ConverterType", bound=Callable[[Any], Any])

View File

@ -1,10 +1,17 @@
import abc import abc
from typing import Optional, Any, Tuple, Text, Callable, Dict from typing import Optional, Any, Tuple, Callable, Dict
import six import six
from .converters import any_to_bool from .converters import any_to_bool
try:
from typing import Text
except ImportError:
# windows conda-less hack
Text = Any
NotSet = object() NotSet = object()
Converter = Callable[[Any], Any] Converter = Callable[[Any], Any]