[clang] #101784 part 2: fix error handling of TranslationUnit.reparse (PR #102410)

via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 8 07:05:59 PDT 2024


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 98e4413a38f286147b863a6ead9625228ab0ec7d...c11dcf93d924eb9347d4cc9833c8b684920dfba0 clang/bindings/python/clang/cindex.py
``````````

</details>

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

``````````diff
--- cindex.py	2024-08-08 01:25:52.000000 +0000
+++ cindex.py	2024-08-08 14:05:24.548157 +0000
@@ -151,11 +151,11 @@
 
 ### Exception Classes ###
 
 
 class CXError(Exception):
-    '''Represents C error of type enum CXErrorCode.'''
+    """Represents C error of type enum CXErrorCode."""
 
     # A generic error code, no further details are available.
     #
     # Errors of this kind can get their own specific error codes in future
     # libclang versions.
@@ -3300,11 +3300,11 @@
         unsaved_files_array = self.process_unsaved_files(unsaved_files)
         result = conf.lib.clang_reparseTranslationUnit(
             self, len(unsaved_files), unsaved_files_array, options
         )
         if result != 0:
-            raise CXError(result, 'Error reparsing TranslationUnit.')
+            raise CXError(result, "Error reparsing TranslationUnit.")
 
     def save(self, filename):
         """Saves the TranslationUnit to a file.
 
         This is equivalent to passing -emit-ast to the clang frontend. The

``````````

</details>


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


More information about the cfe-commits mailing list