summaryrefslogtreecommitdiff
path: root/src/python/m5
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2009-09-22 15:24:16 -0700
committerNathan Binkert <nate@binkert.org>2009-09-22 15:24:16 -0700
commit0d58d32ad51eed32e6c7f9135b901006777fbe87 (patch)
treed2690d1d82e1f321fe5e1c953f1f28717d5c8e05 /src/python/m5
parenteec67312b5990dd73c6330e74bff978ad300f780 (diff)
downloadgem5-0d58d32ad51eed32e6c7f9135b901006777fbe87.tar.xz
multiattrdict: make multilevel nesting work properly
Diffstat (limited to 'src/python/m5')
-rw-r--r--src/python/m5/util/attrdict.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/python/m5/util/attrdict.py b/src/python/m5/util/attrdict.py
index 3336632f5..8f7d59698 100644
--- a/src/python/m5/util/attrdict.py
+++ b/src/python/m5/util/attrdict.py
@@ -58,7 +58,7 @@ class multiattrdict(attrdict):
try:
return super(multiattrdict, self).__getattr__(attr)
except AttributeError:
- d = optiondict()
+ d = multiattrdict()
setattr(self, attr, d)
return d
@@ -86,8 +86,12 @@ if __name__ == '__main__':
print dir(x)
print(x)
+ print
+ print "multiattrdict"
x = multiattrdict()
+ x.x.x.x = 9
x.y.z = 9
print x
print x.y
print x.y.z
+ print x.z.z