From 0d58d32ad51eed32e6c7f9135b901006777fbe87 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Tue, 22 Sep 2009 15:24:16 -0700 Subject: multiattrdict: make multilevel nesting work properly --- src/python/m5/util/attrdict.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/python') 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 -- cgit v1.2.3