misc: Replace __metaclass__ with six.add_metaclass

Change-Id: I45f73b71266c1edf9c4ec521d58db779b16bd591
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26245
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Giacomo Travaglini
2020-02-28 14:56:16 +00:00
parent 4e7fe439d7
commit 3c1f87c81c
5 changed files with 12 additions and 7 deletions

View File

@@ -45,6 +45,7 @@ import functools
import imp
import os
import re
import six
import sys
import zlib
@@ -142,12 +143,12 @@ class SourceMeta(type):
super(SourceMeta, cls).__init__(name, bases, dict)
cls.all = SourceList()
@six.add_metaclass(SourceMeta)
class SourceFile(object):
'''Base object that encapsulates the notion of a source file.
This includes, the source node, target node, various manipulations
of those. A source file also specifies a set of tags which
describing arbitrary properties of the source file.'''
__metaclass__ = SourceMeta
static_objs = {}
shared_objs = {}
@@ -413,9 +414,9 @@ class ExecutableMeta(type):
cls.all = []
@six.add_metaclass(ExecutableMeta)
class Executable(object):
'''Base class for creating an executable from sources.'''
__metaclass__ = ExecutableMeta
abstract = True

View File

@@ -100,6 +100,9 @@ def template MicroFpOpConstructor {{
}};
let {{
import six
# Make these empty strings so that concatenating onto
# them will always work.
header_output = ""
@@ -192,8 +195,8 @@ let {{
return cls
@six.add_metaclass(FpOpMeta)
class FpUnaryOp(X86Microop):
__metaclass__ = FpOpMeta
# This class itself doesn't act as a microop
abstract = True
@@ -228,8 +231,8 @@ let {{
"dataSize" : self.dataSize,
"spm" : self.spm}
@six.add_metaclass(FpOpMeta)
class FpBinaryOp(X86Microop):
__metaclass__ = FpOpMeta
# This class itself doesn't act as a microop
abstract = True

View File

@@ -194,8 +194,8 @@ let {{
return cls
@six.add_metaclass(MediaOpMeta)
class MediaOp(X86Microop):
__metaclass__ = MediaOpMeta
# This class itself doesn't act as a microop
abstract = True

View File

@@ -373,8 +373,8 @@ let {{
return cls
@six.add_metaclass(RegOpMeta)
class RegOp(X86Microop):
__metaclass__ = RegOpMeta
# This class itself doesn't act as a microop
abstract = True

View File

@@ -38,6 +38,7 @@ import multiprocessing.pool
import os
import re
import subprocess
import six
import sys
script_path = os.path.abspath(inspect.getfile(inspect.currentframe()))
@@ -109,8 +110,8 @@ class TestPhaseMeta(type):
super(TestPhaseMeta, cls).__init__(name, bases, d)
@six.add_metaclass(TestPhaseMeta)
class TestPhaseBase(object):
__metaclass__ = TestPhaseMeta
abstract = True
def __init__(self, main_args, *args):