[clang] [libclang/python] Do not rely on `ctypes`' `errcheck` (PR #105490)

Vlad Serebrennikov via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 12 10:16:54 PDT 2024


================
@@ -3524,16 +3564,20 @@ def getCompileCommands(self, filename):
         Get an iterable object providing all the CompileCommands available to
         build filename. Returns None if filename is not found in the database.
         """
-        return conf.lib.clang_CompilationDatabase_getCompileCommands(  # type: ignore [no-any-return]
-            self, os.fspath(filename)
+        return CompileCommands.from_result(
+            conf.lib.clang_CompilationDatabase_getCompileCommands(  # type: ignore [no-any-return]
+                self, os.fspath(filename)
+            )
         )
 
     def getAllCompileCommands(self):
         """
         Get an iterable object providing all the CompileCommands available from
         the database.
         """
-        return conf.lib.clang_CompilationDatabase_getAllCompileCommands(self)  # type: ignore [no-any-return]
+        return CompileCommands.from_result(
+            conf.lib.clang_CompilationDatabase_getAllCompileCommands(self)  # type: ignore [no-any-return]
----------------
Endilll wrote:

I don't think this fits into 80 columns limit. Our Python code is formatted with `black`, so we should keep it in a good shape.

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


More information about the cfe-commits mailing list