Fix crash when loading YAML (disable type checking)

pull/357/head
nyanpasu64 2018-07-29 05:35:05 -07:00
rodzic 4b231eaf5d
commit 042c8a3be5
1 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -93,10 +93,10 @@ class _ConfigMixin:
value = getattr(self, key)
typ = field.type
# FIXME crashes on generics, https://github.com/Stewori/pytypes ?
if not isinstance(value, typ):
name = type(self).__name__
raise OvgenError(f'{name}.{key} was supplied {repr(value)}, should be of type {typ.__name__}')
# # FIXME crashes on generics, https://github.com/Stewori/pytypes ?
# if not isinstance(value, typ):
# name = type(self).__name__
# raise OvgenError(f'{name}.{key} was supplied {repr(value)}, should be of type {typ.__name__}')
if hasattr(self, '__post_init__'):
self.__post_init__()