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

via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 2 02:53:04 PDT 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {darker}-->


:warning: Python code formatter, darker found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
darker --check --diff -r HEAD~1...HEAD clang/bindings/python/clang/cindex.py
``````````

</details>

<details>
<summary>
View the diff from darker here.
</summary>

``````````diff
--- cindex.py	2025-06-02 09:45:33.000000 +0000
+++ cindex.py	2025-06-02 09:52:37.367072 +0000
@@ -4369,12 +4369,15 @@
     def get_cindex_library(self) -> CDLL:
         try:
             library = cdll.LoadLibrary(self.get_filename())
         except OSError as e:
             if "wrong ELF class: ELFCLASS32" in str(e):
-                print("warning: skipping check-clang-python"
-                      " since libclang cannot be loaded", file=sys.stderr)
+                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 "

``````````

</details>


https://github.com/llvm/llvm-project/pull/142353


More information about the cfe-commits mailing list