@@ -1255,24 +1255,26 @@ def create_output_dirs(output_dir, control_flow):
12551255 help = "extract metadata of the target repository using Github API. (requires repository to have the .git folder)" )
12561256@click .option ('-df' , '--data_flow' , type = bool , is_flag = True ,
12571257 help = "extract data flow graph of every function in the target repository" )
1258-
12591258def main (input_path , output_dir , ignore_dir_pattern , ignore_file_pattern , requirements , html_output , call_list ,
12601259 control_flow , directory_tree , software_invocation , abstract_syntax_tree , source_code , license_detection , readme ,
12611260 metadata , data_flow , symbol_table ):
12621261 if data_flow :
1263- if symbol_table == "my_language.so" : # default option
1264- path_to_languages = str (Path (__file__ ).parent / "resources" )
1265- if sys .platform .startswith ("win" ) or sys .platform .startswith ("cygwin" ):
1266- language = Language (path_to_languages + os .path .sep + "python_win.so" , "python" )
1267- elif sys .platform .startswith ("darwin" ):
1268- language = Language (path_to_languages + os .path .sep + "python_mac.so" , "python" )
1262+ try :
1263+ if symbol_table == "my_language.so" : # default option
1264+ path_to_languages = str (Path (__file__ ).parent / "resources" )
1265+ if sys .platform .startswith ("win" ) or sys .platform .startswith ("cygwin" ):
1266+ language = Language (path_to_languages + os .path .sep + "python_win.so" , "python" )
1267+ elif sys .platform .startswith ("darwin" ):
1268+ language = Language (path_to_languages + os .path .sep + "python_mac.so" , "python" )
1269+ else :
1270+ language = Language (path_to_languages + os .path .sep + "python_unix.so" , "python" )
12691271 else :
1270- language = Language (path_to_languages + os . path . sep + "python_unix.so" , "python" )
1271- else :
1272- language = Language ( symbol_table , "python" )
1273- parser = Parser ()
1274- parser . set_language ( language )
1275- parser = [ parser , DFG_python ]
1272+ language = Language (symbol_table , "python" )
1273+ parser = Parser ()
1274+ parser . set_language ( language )
1275+ parser = [ parser , DFG_python ]
1276+ except Exception as e :
1277+ print ( "Problem loading language file " + str ( e ))
12761278 else :
12771279 parser = []
12781280
0 commit comments