From 09616bdb4a49d0dfe46cdec8a701ce50bf67eea7 Mon Sep 17 00:00:00 2001 From: Serge Guelton Date: Mon, 3 Dec 2018 12:12:48 +0000 Subject: Portable Python script across version Have all classes derive from object: that's implicitly the default in Python3, it needs to be done explicilty in Python2. Differential Revision: https://reviews.llvm.org/D55121 llvm-svn: 348127 --- clang/bindings/python/clang/cindex.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'clang/bindings/python') diff --git a/clang/bindings/python/clang/cindex.py b/clang/bindings/python/clang/cindex.py index f87f8304010..939213d302d 100644 --- a/clang/bindings/python/clang/cindex.py +++ b/clang/bindings/python/clang/cindex.py @@ -400,7 +400,7 @@ class Diagnostic(object): @property def ranges(self): - class RangeIterator: + class RangeIterator(object): def __init__(self, diag): self.diag = diag @@ -416,7 +416,7 @@ class Diagnostic(object): @property def fixits(self): - class FixItIterator: + class FixItIterator(object): def __init__(self, diag): self.diag = diag @@ -436,7 +436,7 @@ class Diagnostic(object): @property def children(self): - class ChildDiagnosticsIterator: + class ChildDiagnosticsIterator(object): def __init__(self, diag): self.diag_set = conf.lib.clang_getChildDiagnostics(diag) @@ -2475,8 +2475,8 @@ SpellingCache = { # 20: CompletionChunk.Kind("VerticalSpace") } -class CompletionChunk: - class Kind: +class CompletionChunk(object): + class Kind(object): def __init__(self, name): self.name = name @@ -2563,7 +2563,7 @@ completionChunkKindMap = { 20: CompletionChunk.Kind("VerticalSpace")} class CompletionString(ClangObject): - class Availability: + class Availability(object): def __init__(self, name): self.name = name @@ -2656,7 +2656,7 @@ class CodeCompletionResults(ClangObject): @property def diagnostics(self): - class DiagnosticsItr: + class DiagnosticsItr(object): def __init__(self, ccr): self.ccr= ccr @@ -2958,7 +2958,7 @@ class TranslationUnit(ClangObject): """ Return an iterable (and indexable) object containing the diagnostics. """ - class DiagIterator: + class DiagIterator(object): def __init__(self, tu): self.tu = tu @@ -4090,7 +4090,7 @@ def register_functions(lib, ignore_errors): for f in functionList: register(f) -class Config: +class Config(object): library_path = None library_file = None compatibility_check = True -- cgit v1.2.3