From 420402c0a314f515ff1e84d6c6da4892e006c92e Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Mon, 14 Jun 2010 23:24:46 -0700 Subject: [PATCH] util: clean up attrdict and import multiattrdict into m5.util --- src/python/m5/util/__init__.py | 2 +- src/python/m5/util/attrdict.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/python/m5/util/__init__.py b/src/python/m5/util/__init__.py index 7a674dd2d..e87096841 100644 --- a/src/python/m5/util/__init__.py +++ b/src/python/m5/util/__init__.py @@ -34,7 +34,7 @@ import sys import convert import jobfile -from attrdict import attrdict, optiondict +from attrdict import attrdict, multiattrdict, optiondict from code_formatter import code_formatter from multidict import multidict from orderdict import orderdict diff --git a/src/python/m5/util/attrdict.py b/src/python/m5/util/attrdict.py index 8f7d59698..cb83e9e24 100644 --- a/src/python/m5/util/attrdict.py +++ b/src/python/m5/util/attrdict.py @@ -58,6 +58,9 @@ class multiattrdict(attrdict): try: return super(multiattrdict, self).__getattr__(attr) except AttributeError: + if attr.startswith('_'): + raise + d = multiattrdict() setattr(self, attr, d) return d