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
diff --git a/clang/utils/ABITest/ABITestGen.py b/clang/utils/ABITest/ABITestGen.py
index d45ac77d..0e588f0 100755
--- a/clang/utils/ABITest/ABITestGen.py
+++ b/clang/utils/ABITest/ABITestGen.py
@@ -10,7 +10,7 @@
####
-class TypePrinter:
+class TypePrinter(object):
def __init__(self, output, outputHeader=None,
outputTests=None, outputDriver=None,
headerName=None, info=None):
diff --git a/clang/utils/ABITest/TypeGen.py b/clang/utils/ABITest/TypeGen.py
index 7bbf0d8..0768bb7 100644
--- a/clang/utils/ABITest/TypeGen.py
+++ b/clang/utils/ABITest/TypeGen.py
@@ -17,7 +17,7 @@
###
# Actual type types
-class Type:
+class Type(object):
def isBitField(self):
return False
diff --git a/clang/utils/analyzer/CmpRuns.py b/clang/utils/analyzer/CmpRuns.py
index ab8c48b..43d1fe8 100755
--- a/clang/utils/analyzer/CmpRuns.py
+++ b/clang/utils/analyzer/CmpRuns.py
@@ -38,7 +38,7 @@
STATS_REGEXP = re.compile(r"Statistics: (\{.+\})", re.MULTILINE | re.DOTALL)
-class Colors:
+class Colors(object):
"""
Color for terminal highlight.
"""
@@ -50,14 +50,14 @@
# path - the analysis output directory
# root - the name of the root directory, which will be disregarded when
# determining the source file name
-class SingleRunInfo:
+class SingleRunInfo(object):
def __init__(self, path, root="", verboseLog=None):
self.path = path
self.root = root.rstrip("/\\")
self.verboseLog = verboseLog
-class AnalysisDiagnostic:
+class AnalysisDiagnostic(object):
def __init__(self, data, report, htmlReport):
self._data = data
self._loc = self._data['location']
@@ -117,14 +117,14 @@
return self._data
-class AnalysisReport:
+class AnalysisReport(object):
def __init__(self, run, files):
self.run = run
self.files = files
self.diagnostics = []
-class AnalysisRun:
+class AnalysisRun(object):
def __init__(self, info):
self.path = info.path
self.root = info.root
diff --git a/clang/utils/modfuzz.py b/clang/utils/modfuzz.py
index a6aa1f1..885621d 100644
--- a/clang/utils/modfuzz.py
+++ b/clang/utils/modfuzz.py
@@ -12,7 +12,7 @@
clang = sys.argv[1]
none_opts = 0.3
-class Decl:
+class Decl(object):
def __init__(self, text, depends=[], provides=[], conflicts=[]):
self.text = text
self.depends = depends
@@ -39,7 +39,7 @@
Decl('X %(name)s;\n', depends=['X']),
]
-class FS:
+class FS(object):
def __init__(self):
self.fs = {}
self.prevfs = {}
@@ -62,7 +62,7 @@
fs = FS()
-class CodeModel:
+class CodeModel(object):
def __init__(self):
self.source = ''
self.modules = {}
diff --git a/clang/utils/token-delta.py b/clang/utils/token-delta.py
index f912547..5efb65c 100755
--- a/clang/utils/token-delta.py
+++ b/clang/utils/token-delta.py
@@ -94,7 +94,7 @@
###
-class Token:
+class Token(object):
def __init__(self, type, data, flags, file, line, column):
self.type = type
self.data = data