From 34bf531fe55a681b8ed84e1925e10bab79b1be44 Mon Sep 17 00:00:00 2001 From: Alp Toker <alp@nuanti.com> Date: Sun, 20 Apr 2014 01:07:03 +0000 Subject: [PATCH] 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 --- bindings/python/clang/cindex.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bindings/python/clang/cindex.py b/bindings/python/clang/cindex.py index 5078825f147..eea7d331aef 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), -- GitLab