diff options
Diffstat (limited to 'src/python/m5/proxy.py')
-rw-r--r-- | src/python/m5/proxy.py | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/python/m5/proxy.py b/src/python/m5/proxy.py index c0bf84a93..2a3250020 100644 --- a/src/python/m5/proxy.py +++ b/src/python/m5/proxy.py @@ -66,16 +66,16 @@ class BaseProxy(object): def __setattr__(self, attr, value): if not attr.startswith('_'): - raise AttributeError, \ - "cannot set attribute '%s' on proxy object" % attr + raise AttributeError( + "cannot set attribute '%s' on proxy object" % attr) super(BaseProxy, self).__setattr__(attr, value) # support for multiplying proxies by constants or other proxies to # other params def __mul__(self, other): if not (isinstance(other, (int, long, float)) or isproxy(other)): - raise TypeError, \ - "Proxy multiplier must be a constant or a proxy to a param" + raise TypeError( + "Proxy multiplier must be a constant or a proxy to a param") self._multipliers.append(other) return self @@ -88,8 +88,8 @@ class BaseProxy(object): # assert that we are multiplying with a compatible # param if not isinstance(multiplier, params.NumericParamValue): - raise TypeError, \ - "Proxy multiplier must be a numerical param" + raise TypeError( + "Proxy multiplier must be a numerical param") multiplier = multiplier.getValue() result *= multiplier return result @@ -116,13 +116,13 @@ class BaseProxy(object): base._visited = False if not done: - raise AttributeError, \ - "Can't resolve proxy '%s' of type '%s' from '%s'" % \ - (self.path(), self._pdesc.ptype_str, base.path()) + raise AttributeError( + "Can't resolve proxy '%s' of type '%s' from '%s'" % \ + (self.path(), self._pdesc.ptype_str, base.path())) if isinstance(result, BaseProxy): if result == self: - raise RuntimeError, "Cycle in unproxy" + raise RuntimeError("Cycle in unproxy") result = result.unproxy(obj) return self._mulcheck(result, base) @@ -157,7 +157,7 @@ class AttrProxy(BaseProxy): if attr.startswith('_'): return super(AttrProxy, self).__getattr__(self, attr) if hasattr(self, '_pdesc'): - raise AttributeError, "Attribute reference on bound proxy" + raise AttributeError("Attribute reference on bound proxy") # Return a copy of self rather than modifying self in place # since self could be an indirect reference via a variable or # parameter @@ -168,9 +168,9 @@ class AttrProxy(BaseProxy): # support indexing on proxies (e.g., Self.cpu[0]) def __getitem__(self, key): if not isinstance(key, int): - raise TypeError, "Proxy object requires integer index" + raise TypeError("Proxy object requires integer index") if hasattr(self, '_pdesc'): - raise AttributeError, "Index operation on bound proxy" + raise AttributeError("Index operation on bound proxy") new_self = copy.deepcopy(self) new_self._modifiers.append(key) return new_self |