diff options
author | Serge Guelton <sguelton@quarkslab.com> | 2018-12-03 12:12:48 +0000 |
---|---|---|
committer | Serge Guelton <sguelton@quarkslab.com> | 2018-12-03 12:12:48 +0000 |
commit | cced340d0717c3d0e059b532628ad2120789364f (patch) | |
tree | 43daf268b7c433e6201af1dd5d99f2dd87d6b679 /docs | |
parent | ba2e3ae0a66adc4c70f943063abd494ddbadfc89 (diff) |
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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348127 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs')
-rwxr-xr-x | docs/tools/dump_format_style.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/docs/tools/dump_format_style.py b/docs/tools/dump_format_style.py index 3d61227f73..2e1e8c1229 100755 --- a/docs/tools/dump_format_style.py +++ b/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 |