Skip to content

[clang][python][test] Check if libclang.so is loadable #142353

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions clang/bindings/python/clang/cindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -4370,12 +4370,17 @@ def get_cindex_library(self) -> CDLL:
try:
library = cdll.LoadLibrary(self.get_filename())
except OSError as e:
msg = (
str(e) + ". To provide a path to libclang use "
"Config.set_library_path() or "
"Config.set_library_file()."
)
raise LibclangError(msg)
if "wrong ELF class: ELFCLASS32" in str(e):
print("warning: skipping check-clang-python"
" since libclang cannot be loaded", file=sys.stderr)
os._exit(0)
else:
msg = (
str(e) + ". To provide a path to libclang use "
"Config.set_library_path() or "
"Config.set_library_file()."
)
raise LibclangError(msg)

return library

Expand Down
Loading