Skip to content
Snippets Groups Projects
Commit 24fd4b39 authored by li213's avatar li213
Browse files

fix small bug due to inconsistency between python 3.8 and 3.10

parent aee1a10d
No related branches found
No related tags found
No related merge requests found
...@@ -414,10 +414,15 @@ class ControllerAst(): ...@@ -414,10 +414,15 @@ class ControllerAst():
arg_annotation = arg.annotation.id arg_annotation = arg.annotation.id
# Handle case when input is a list of variables # Handle case when input is a list of variables
elif isinstance(arg.annotation, ast.Subscript): elif isinstance(arg.annotation, ast.Subscript):
if arg.annotation.slice.value.id not in state_object_dict: if isinstance(arg.annotation.slice, ast.Index):
continue if arg.annotation.slice.value.id not in state_object_dict:
arg_annotation = arg.annotation.slice.value.id continue
arg_annotation = arg.annotation.slice.value.id
elif isinstance(arg.annotation.slice, ast.Name):
if arg.annotation.slice.id not in state_object_dict:
continue
arg_annotation = arg.annotation.slice.id
arg_name = arg.arg arg_name = arg.arg
vars_dict[arg_name] = {'cont':[], 'disc':[], "type": []} vars_dict[arg_name] = {'cont':[], 'disc':[], "type": []}
for var in state_object_dict[arg_annotation]['cont']: for var in state_object_dict[arg_annotation]['cont']:
......
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