[libclang/python] Add check for reparsing (#172373)
Add error checking for `reparseTranslationUnit`.
This commit is contained in:
parent
60e7c4709c
commit
3fd31924c5
1 changed files with 7 additions and 2 deletions
|
|
@ -3598,9 +3598,14 @@ class TranslationUnit(ClangObject):
|
|||
unsaved_files = []
|
||||
|
||||
unsaved_files_array = self.process_unsaved_files(unsaved_files)
|
||||
ptr = conf.lib.clang_reparseTranslationUnit(
|
||||
self, len(unsaved_files), unsaved_files_array, options
|
||||
result = int(
|
||||
conf.lib.clang_reparseTranslationUnit(
|
||||
self, len(unsaved_files), unsaved_files_array, options
|
||||
)
|
||||
)
|
||||
if result != 0:
|
||||
msg = "Error reparsing translation unit. Error code: " + str(result)
|
||||
raise TranslationUnitLoadError(msg)
|
||||
|
||||
def save(self, filename):
|
||||
"""Saves the TranslationUnit to a file.
|
||||
|
|
|
|||
Loading…
Reference in a new issue