Type conversion: Workaround typing module changes in Python 3.7
See for details.
@@ -27,6 +27,7 @@ except ImportError: # Standard in Py 3.4+ but can be separately installed
class Enum(object):
pass
from numbers import Integral, Real
+import sys
from robot.libraries.DateTime import convert_date, convert_time
from robot.utils import FALSE_STRINGS, IRONPYTHON, TRUE_STRINGS, PY2, unicode
@@ -49,6 +50,10 @@ class TypeConverter(object):
@classmethod
def converter_for(cls, type_):
+ # Types defined in the typing module in Python 3.7+. For details see
+ # https://bugs.python.org/issue34568
+ if sys.version_info >= (3, 7) and hasattr(type_, '__origin__'):
+ type_ = type_.__origin__
if not isinstance(type_, type) or issubclass(type_, unicode):
return None
if type_ in cls._converters:
