diff options
author | Andreas Sandberg <andreas.sandberg@arm.com> | 2019-01-25 11:32:25 +0000 |
---|---|---|
committer | Andreas Sandberg <andreas.sandberg@arm.com> | 2019-02-12 09:38:12 +0000 |
commit | fa21127a646b8d2a61fe412728762250ca38ecd2 (patch) | |
tree | 8f0c21351c0e7c7e30b1c03a81c3d4f122f566c5 /src/python/m5/ticks.py | |
parent | 6ba4545b1f9553e68e992305c92cf46246a79dae (diff) | |
download | gem5-fa21127a646b8d2a61fe412728762250ca38ecd2.tar.xz |
python: Make exception handling Python 3 safe
Change-Id: I9c2cdfad20deb1ddfa224320cf93f2105d126652
Reviewed-on: https://gem5-review.googlesource.com/c/15980
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Diffstat (limited to 'src/python/m5/ticks.py')
-rw-r--r-- | src/python/m5/ticks.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/python/m5/ticks.py b/src/python/m5/ticks.py index e4b5eac7e..22a5738d3 100644 --- a/src/python/m5/ticks.py +++ b/src/python/m5/ticks.py @@ -47,8 +47,8 @@ def setGlobalFrequency(ticksPerSecond): elif isinstance(ticksPerSecond, str): tps = round(convert.anyToFrequency(ticksPerSecond)) else: - raise TypeError, \ - "wrong type '%s' for ticksPerSecond" % type(ticksPerSecond) + raise TypeError( + "wrong type '%s' for ticksPerSecond" % type(ticksPerSecond)) _m5.core.setClockFrequency(int(tps)) # how big does a rounding error need to be before we warn about it? @@ -58,13 +58,13 @@ def fromSeconds(value): import _m5.core if not isinstance(value, float): - raise TypeError, "can't convert '%s' to type tick" % type(value) + raise TypeError("can't convert '%s' to type tick" % type(value)) # once someone needs to convert to seconds, the global frequency # had better be fixed if not _m5.core.clockFrequencyFixed(): - raise AttributeError, \ - "In order to do conversions, the global frequency must be fixed" + raise AttributeError( + "In order to do conversions, the global frequency must be fixed") if value == 0: return 0 |