misc: Make exception handling python3 compliant

Change-Id: I37d0e97e9762e21c7a0ad315cf7684a19119b5b4
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26251
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
This commit is contained in:
Giacomo Travaglini
2020-03-02 15:18:56 +00:00
parent e06ec8c423
commit 1bf2821ae7
16 changed files with 52 additions and 43 deletions

View File

@@ -382,7 +382,7 @@ class SimObject(PySource):
the m5.objects package)'''
super(SimObject, self).__init__('m5.objects', source, tags, add_tags)
if self.fixed:
raise AttributeError, "Too late to call SimObject now."
raise AttributeError("Too late to call SimObject now.")
bisect.insort_right(SimObject.modnames, self.modname)
@@ -552,12 +552,12 @@ Export('GTest')
debug_flags = {}
def DebugFlag(name, desc=None):
if name in debug_flags:
raise AttributeError, "Flag %s already specified" % name
raise AttributeError("Flag {} already specified".format(name))
debug_flags[name] = (name, (), desc)
def CompoundFlag(name, flags, desc=None):
if name in debug_flags:
raise AttributeError, "Flag %s already specified" % name
raise AttributeError("Flag {} already specified".format(name))
compound = tuple(flags)
debug_flags[name] = (name, compound, desc)