util: clean up attrdict and import multiattrdict into m5.util

This commit is contained in:
Nathan Binkert 2010-06-14 23:24:46 -07:00
parent 5fc7adcba0
commit 420402c0a3
2 changed files with 4 additions and 1 deletions

View file

@ -34,7 +34,7 @@ import sys
import convert import convert
import jobfile import jobfile
from attrdict import attrdict, optiondict from attrdict import attrdict, multiattrdict, optiondict
from code_formatter import code_formatter from code_formatter import code_formatter
from multidict import multidict from multidict import multidict
from orderdict import orderdict from orderdict import orderdict

View file

@ -58,6 +58,9 @@ class multiattrdict(attrdict):
try: try:
return super(multiattrdict, self).__getattr__(attr) return super(multiattrdict, self).__getattr__(attr)
except AttributeError: except AttributeError:
if attr.startswith('_'):
raise
d = multiattrdict() d = multiattrdict()
setattr(self, attr, d) setattr(self, attr, d)
return d return d