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

Jannick Kremer via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 12 15:54:16 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]
----------------
DeinAlptraum wrote:

I already `black`'ed the code. This cannot be fixed to below 80 characters, otherwise the CI would have failed as well.

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


More information about the cfe-commits mailing list