File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -280,8 +280,13 @@ def read_args(args):
280280 if 'LIBCLANG_PATH' in os .environ :
281281 cindex .Config .set_library_file (os .environ ['LIBCLANG_PATH' ])
282282 else :
283- library_file = sorted (glob ("/usr/lib/llvm-*/lib/libclang.so.1" ), reverse = True )[0 ]
284- cindex .Config .set_library_file (library_file )
283+ library_file_dirs = glob ("/usr/lib/llvm-*/lib/libclang.so.1" )
284+ if len (library_file_dirs ) > 0 :
285+ library_file = sorted (library_file_dirs , reverse = True )[0 ]
286+ cindex .Config .set_library_file (library_file )
287+ else :
288+ raise FileNotFoundError ("Failed to find libclang.so shared object file! "
289+ "Set the LIBCLANG_PATH environment variable to provide a path to it." )
285290
286291 # clang doesn't find its own base includes by default on Linux,
287292 # but different distros install them in different paths.
You can’t perform that action at this time.
0 commit comments