diff options
author | Dylan Baker <[email protected]> | 2016-05-31 11:31:18 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-05-31 15:09:06 -0700 |
commit | de2e9da2e9b0bfeca535f318c20df93b3a0fd08b (patch) | |
tree | e97ed23257e7c650c51bf465851941670ad38bb7 /src/intel/genxml/gen_pack_header.py | |
parent | 9f50e3572ceca6179438157de04c65d6300902da (diff) |
genxml: Make classes descendants of object
This is the default in python3, but in python2 you get old style
classes. No one likes old-style classes.
Signed-off-by: Dylan Baker <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
cc: 12.0 <[email protected]>
Diffstat (limited to 'src/intel/genxml/gen_pack_header.py')
-rw-r--r-- | src/intel/genxml/gen_pack_header.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/intel/genxml/gen_pack_header.py b/src/intel/genxml/gen_pack_header.py index 2920ec97c23..2a7e2652264 100644 --- a/src/intel/genxml/gen_pack_header.py +++ b/src/intel/genxml/gen_pack_header.py @@ -210,7 +210,7 @@ def num_from_str(num_str): assert(not num_str.startswith('0') and 'octals numbers not allowed') return int(num_str) -class Field: +class Field(object): ufixed_pattern = re.compile("u(\d+)\.(\d+)") sfixed_pattern = re.compile("s(\d+)\.(\d+)") @@ -279,7 +279,7 @@ class Field: for value in self.values: print("#define %-40s %d" % (prefix + value.name, value.value)) -class Group: +class Group(object): def __init__(self, parser, parent, start, count, size): self.parser = parser self.parent = parent @@ -467,12 +467,12 @@ class Group: print(" dw[%d] = %s;" % (index, v)) print(" dw[%d] = %s >> 32;" % (index + 1, v)) -class Value: +class Value(object): def __init__(self, attrs): self.name = safe_name(attrs["name"]) self.value = int(attrs["value"]) -class Parser: +class Parser(object): def __init__(self): self.parser = xml.parsers.expat.ParserCreate() self.parser.StartElementHandler = self.start_element |