Skip to content
Snippets Groups Projects
Commit f4fefffa authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

copy

parent 72713f1c
No related branches found
No related tags found
No related merge requests found
...@@ -357,8 +357,9 @@ def _get_descriptor_for(key: str, value: tp.Any) -> Descriptor: ...@@ -357,8 +357,9 @@ def _get_descriptor_for(key: str, value: tp.Any) -> Descriptor:
else: else:
args = (import_class(cast_to),) args = (import_class(cast_to),)
if 'expr' in value: if 'expr' in value:
y = args[0] locals_ = locals().copy()
args = eval('lambda x: ' + value['expr'], globals(), locals()), locals_['y'] = args[0]
args = eval('lambda x: ' + value['expr'], globals(), locals_),
elif type_ == 'union': elif type_ == 'union':
args = [_get_descriptor_for('', x) for x in value.get('of', [])] args = [_get_descriptor_for('', x) for x in value.get('of', [])]
optional, default = False, None optional, default = False, None
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment