aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Szorc <gregory.szorc@gmail.com>2012-05-12 20:49:13 +0000
committerGregory Szorc <gregory.szorc@gmail.com>2012-05-12 20:49:13 +0000
commit2283b4664b004aae034b08f305ad2bc1dff9868e (patch)
tree5a17a68dd819b84ee582d52ffc67e7a6f9de18c4
parent63419001f0df336655270dc0b757b0da5aa957f0 (diff)
[clang.py] Followup to TranslationUnit refactor
* Document index argument in TranslationUnit.from_source * Add numeric error code to TranslationUnitSaveError string representation * Use None instead of [] for default argument value in TranslationUnit.codeComplete git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156722 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--bindings/python/clang/cindex.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/bindings/python/clang/cindex.py b/bindings/python/clang/cindex.py
index fa82294130..0053796462 100644
--- a/bindings/python/clang/cindex.py
+++ b/bindings/python/clang/cindex.py
@@ -126,7 +126,7 @@ class TranslationUnitSaveError(Exception):
"value supported." % enumeration)
self.save_error = enumeration
- Exception.__init__(self, message)
+ Exception.__init__(self, 'Error %d: %s' % (enumeration, message))
### Structures and Utility Classes ###
@@ -1739,6 +1739,9 @@ class TranslationUnit(ClangObject):
options is a bitwise or of TranslationUnit.PARSE_XXX flags which will
control parsing behavior.
+ index is an Index instance to utilize. If not provided, a new Index
+ will be created for this TranslationUnit.
+
To parse source from the filesystem, the filename of the file to parse
is specified by the filename argument. Or, filename could be None and
the args list would contain the filename(s) to parse.
@@ -1925,7 +1928,7 @@ class TranslationUnit(ClangObject):
raise TranslationUnitSaveError(result,
'Error saving TranslationUnit.')
- def codeComplete(self, path, line, column, unsaved_files=[], options=0):
+ def codeComplete(self, path, line, column, unsaved_files=None, options=0):
"""
Code complete in this translation unit.