kopia lustrzana https://github.com/corrscope/corrscope
Fix crash when loading YAML (disable type checking)
rodzic
4b231eaf5d
commit
042c8a3be5
|
@ -93,10 +93,10 @@ class _ConfigMixin:
|
||||||
value = getattr(self, key)
|
value = getattr(self, key)
|
||||||
typ = field.type
|
typ = field.type
|
||||||
|
|
||||||
# FIXME crashes on generics, https://github.com/Stewori/pytypes ?
|
# # FIXME crashes on generics, https://github.com/Stewori/pytypes ?
|
||||||
if not isinstance(value, typ):
|
# if not isinstance(value, typ):
|
||||||
name = type(self).__name__
|
# name = type(self).__name__
|
||||||
raise OvgenError(f'{name}.{key} was supplied {repr(value)}, should be of type {typ.__name__}')
|
# raise OvgenError(f'{name}.{key} was supplied {repr(value)}, should be of type {typ.__name__}')
|
||||||
|
|
||||||
if hasattr(self, '__post_init__'):
|
if hasattr(self, '__post_init__'):
|
||||||
self.__post_init__()
|
self.__post_init__()
|
||||||
|
|
Ładowanie…
Reference in New Issue