summaryrefslogtreecommitdiffstats
path: root/clang/docs/tools/dump_format_style.py
diff options
context:
space:
mode:
authorSerge Guelton <sguelton@quarkslab.com>2018-12-03 12:12:48 +0000
committerSerge Guelton <sguelton@quarkslab.com>2018-12-03 12:12:48 +0000
commit09616bdb4a49d0dfe46cdec8a701ce50bf67eea7 (patch)
tree7cb4c11cb6fcff38c2de6a9c844c5fbd01c39894 /clang/docs/tools/dump_format_style.py
parent3de410848c245d0b66697062234f2d6980583092 (diff)
downloadbcm5719-llvm-09616bdb4a49d0dfe46cdec8a701ce50bf67eea7.tar.gz
bcm5719-llvm-09616bdb4a49d0dfe46cdec8a701ce50bf67eea7.zip
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
Diffstat (limited to 'clang/docs/tools/dump_format_style.py')
-rwxr-xr-xclang/docs/tools/dump_format_style.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/docs/tools/dump_format_style.py b/clang/docs/tools/dump_format_style.py
index 3d61227f736..2e1e8c12297 100755
--- a/clang/docs/tools/dump_format_style.py
+++ b/clang/docs/tools/dump_format_style.py
@@ -32,7 +32,7 @@ def indent(text, columns, indent_first_line=True):
return s
return indent + s
-class Option:
+class Option(object):
def __init__(self, name, type, comment):
self.name = name
self.type = type
@@ -50,7 +50,7 @@ class Option:
2)
return s
-class NestedStruct:
+class NestedStruct(object):
def __init__(self, name, comment):
self.name = name
self.comment = comment.strip()
@@ -59,7 +59,7 @@ class NestedStruct:
def __str__(self):
return '\n'.join(map(str, self.values))
-class NestedField:
+class NestedField(object):
def __init__(self, name, comment):
self.name = name
self.comment = comment.strip()
@@ -69,7 +69,7 @@ class NestedField:
self.name,
doxygen2rst(indent(self.comment, 2, indent_first_line=False)))
-class Enum:
+class Enum(object):
def __init__(self, name, comment):
self.name = name
self.comment = comment.strip()
@@ -78,7 +78,7 @@ class Enum:
def __str__(self):
return '\n'.join(map(str, self.values))
-class EnumValue:
+class EnumValue(object):
def __init__(self, name, comment):
self.name = name
self.comment = comment
@@ -101,7 +101,7 @@ def clean_comment_line(line):
return line[4:] + '\n'
def read_options(header):
- class State:
+ class State(object):
BeforeStruct, Finished, InStruct, InNestedStruct, InNestedFieldComent, \
InFieldComment, InEnum, InEnumMemberComment = range(8)
state = State.BeforeStruct
OpenPOWER on IntegriCloud