File tree Expand file tree Collapse file tree 1 file changed +11
-13
lines changed
Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -40,19 +40,17 @@ def get_njit_funcs():
4040 file_contents = f .read ()
4141 module = ast .parse (file_contents )
4242 for node in module .body :
43- if isinstance (node , ast .FunctionDef ):
44- func_name = node .name
45- for decorator in node .decorator_list :
46- scenario_1 = isinstance (decorator , ast .Name ) and (
47- decorator .id == "njit"
48- )
49- scenario_2 = (
50- isinstance (decorator , ast .Call )
51- and isinstance (decorator .func , ast .Name )
52- and decorator .func .id == "njit"
53- )
54- if scenario_1 or scenario_2 :
55- njit_funcs .append ((module_name , func_name ))
43+ if not isinstance (node , ast .FunctionDef ):
44+ continue
45+
46+ func_name = node .name
47+ for decorator in node .decorator_list :
48+ if (isinstance (decorator , ast .Name ) and (decorator .id == "njit" )) or (
49+ isinstance (decorator , ast .Call )
50+ and isinstance (decorator .func , ast .Name )
51+ and decorator .func .id == "njit"
52+ ):
53+ njit_funcs .append ((module_name , func_name ))
5654
5755 return njit_funcs
5856
You can’t perform that action at this time.
0 commit comments