summaryrefslogtreecommitdiffstats
path: root/bindings
diff options
context:
space:
mode:
authorAlp Toker <alp@nuanti.com>2014-04-20 01:07:03 +0000
committerAlp Toker <alp@nuanti.com>2014-04-20 01:07:03 +0000
commit34bf531fe55a681b8ed84e1925e10bab79b1be44 (patch)
tree71a9680349792026adf763a7c2caa99a241f41c7 /bindings
parent10e524df5e1856cb7d9893c96f7e8b9a1c777415 (diff)
cindex.py: Avoid deprecated function
Implement Diagnostic::category_name() using clang_getDiagnosticCategoryText() instead of the deprected clang_getDiagnosticCategoryName(). Preserves existing behaviour and API covered by existing tests. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206712 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'bindings')
-rw-r--r--bindings/python/clang/cindex.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/bindings/python/clang/cindex.py b/bindings/python/clang/cindex.py
index 5078825f14..eea7d331ae 100644
--- a/bindings/python/clang/cindex.py
+++ b/bindings/python/clang/cindex.py
@@ -361,13 +361,13 @@ class Diagnostic(object):
@property
def category_number(self):
- """The category number for this diagnostic."""
+ """The category number for this diagnostic or 0 if unavailable."""
return conf.lib.clang_getDiagnosticCategory(self)
@property
def category_name(self):
"""The string name of the category for this diagnostic."""
- return conf.lib.clang_getDiagnosticCategoryName(self.category_number)
+ return conf.lib.clang_getDiagnosticCategoryText(self)
@property
def option(self):
@@ -2922,8 +2922,8 @@ functionList = [
[Diagnostic],
c_uint),
- ("clang_getDiagnosticCategoryName",
- [c_uint],
+ ("clang_getDiagnosticCategoryText",
+ [Diagnostic],
_CXString,
_CXString.from_result),