summaryrefslogtreecommitdiff
path: root/python/m5/config.py
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2005-03-22 14:42:05 -0500
committerNathan Binkert <binkertn@umich.edu>2005-03-22 14:42:05 -0500
commit5f2b3a6e5d38ea257ee7bbe78ef548905f083290 (patch)
treebec65a2cb120da97d3c72ce9f1a076a2c14a6904 /python/m5/config.py
parent95865117bc4a9941a044f3dd25f7a47b0cae4580 (diff)
downloadgem5-5f2b3a6e5d38ea257ee7bbe78ef548905f083290.tar.xz
clean up python exceptions
python/m5/config.py: clean up exception output a bit. --HG-- extra : convert_revision : a27e75276ffc9001f44c44595172cf2b455e5e23
Diffstat (limited to 'python/m5/config.py')
-rw-r--r--python/m5/config.py28
1 files changed, 15 insertions, 13 deletions
diff --git a/python/m5/config.py b/python/m5/config.py
index 68098bf14..8a2a8c275 100644
--- a/python/m5/config.py
+++ b/python/m5/config.py
@@ -202,6 +202,7 @@ class Proxy(object):
raise AttributeError, \
'Parent of %s type %s not found at path %s' \
% (base.name, ptype, self._path)
+
result, done = obj.find(ptype, self._path)
obj = obj.parent
@@ -510,10 +511,9 @@ classes. You're trying to derive from:
p = NodeParam(pname, param, value)
instance.params.append(p)
instance.param_names[pname] = p
- except:
- print 'Exception while evaluating %s.%s' % \
- (instance.path, pname)
- raise
+ except Exception, e:
+ raise e.__class__, 'Exception while evaluating %s.%s\n%s' % \
+ (instance.path, pname, e)
return instance
@@ -694,9 +694,9 @@ class Node(object):
param.value = [ self.unproxy(pv, ptype) for pv in pval ]
else:
param.value = self.unproxy(pval, ptype)
- except:
- print 'Error while fixing up %s:%s' % (self.path, param.name)
- raise
+ except Exception, e:
+ raise e.__class__, 'Error while fixing up %s:%s\n%s' % \
+ (self.path, param.name, e)
for child in self.children:
assert(child != self)
@@ -728,9 +728,9 @@ class Node(object):
value = param.convert(param.value)
string = param.string(value)
- except:
- print 'exception in %s:%s' % (self.path, param.name)
- raise
+ except Exception, e:
+ raise e.__class__, 'exception in %s:%s\n%s' % \
+ (self.path, param.name, e)
print '%s = %s' % (param.name, string)
@@ -763,8 +763,9 @@ class Node(object):
value = param.convert(param.value)
string = param.string(value)
- except:
- print 'exception in %s:%s' % (self.name, param.name)
+ except Exception, e:
+ raise e.__class__, 'exception in %s:%s\n%s' % \
+ (self.name, param.name, e)
raise
if isConfigNode(param.ptype) and string != "Null":
simobjs.append(string)
@@ -773,7 +774,8 @@ class Node(object):
for so in simobjs:
label += "|<%s> %s" % (so, so)
- dot.add_edge(pydot.Edge("%s:%s" % (self.path, so), so, tailport="w"))
+ dot.add_edge(pydot.Edge("%s:%s" % (self.path, so), so,
+ tailport="w"))
label += '}'
dot.add_node(pydot.Node(self.path,shape="Mrecord",label=label))