diff --git a/trains/backend_config/converters.py b/trains/backend_config/converters.py index 96bc574b..c410c34a 100644 --- a/trains/backend_config/converters.py +++ b/trains/backend_config/converters.py @@ -1,9 +1,16 @@ import base64 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 +try: + from typing import Text +except ImportError: + # windows conda-less hack + Text = Any + + ConverterType = TypeVar("ConverterType", bound=Callable[[Any], Any]) diff --git a/trains/backend_config/entry.py b/trains/backend_config/entry.py index 2b175af4..1f2440f0 100644 --- a/trains/backend_config/entry.py +++ b/trains/backend_config/entry.py @@ -1,10 +1,17 @@ import abc -from typing import Optional, Any, Tuple, Text, Callable, Dict +from typing import Optional, Any, Tuple, Callable, Dict import six from .converters import any_to_bool +try: + from typing import Text +except ImportError: + # windows conda-less hack + Text = Any + + NotSet = object() Converter = Callable[[Any], Any]