File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -113,7 +113,12 @@ impl PythonArchBuilder {
113
113
file_info_ast. ast . as_ref ( ) . unwrap ( )
114
114
} ,
115
115
false => {
116
- & AstUtils :: find_stmt_from_ast ( file_info_ast. ast . as_ref ( ) . unwrap ( ) , self . sym_stack [ 0 ] . borrow ( ) . ast_indexes ( ) . unwrap ( ) ) . as_function_def_stmt ( ) . unwrap ( ) . body
116
+ if !self . sym_stack [ 0 ] . borrow ( ) . ast_indexes ( ) . unwrap ( ) . is_empty ( ) {
117
+ & AstUtils :: find_stmt_from_ast ( file_info_ast. ast . as_ref ( ) . unwrap ( ) , self . sym_stack [ 0 ] . borrow ( ) . ast_indexes ( ) . unwrap ( ) ) . as_function_def_stmt ( ) . unwrap ( ) . body
118
+ } else {
119
+ //if ast_index is empty, this is because the function has been added manually and do not belong to the ast. Skip it's building
120
+ & vec ! [ ]
121
+ }
117
122
}
118
123
} ;
119
124
let old_stack_noqa = session. noqas_stack . clone ( ) ;
You can’t perform that action at this time.
0 commit comments