diff options
author | Nathan Binkert <nate@binkert.org> | 2009-09-22 15:24:16 -0700 |
---|---|---|
committer | Nathan Binkert <nate@binkert.org> | 2009-09-22 15:24:16 -0700 |
commit | eec67312b5990dd73c6330e74bff978ad300f780 (patch) | |
tree | f3812c7a1f48821838f5546097b563674af90080 | |
parent | aa78db4adab413600547dc01a9f1db2fbbe8fa44 (diff) | |
download | gem5-eec67312b5990dd73c6330e74bff978ad300f780.tar.xz |
attrdict: add pickle support to attrdict
-rw-r--r-- | src/python/m5/util/attrdict.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/python/m5/util/attrdict.py b/src/python/m5/util/attrdict.py index 0b30258b9..3336632f5 100644 --- a/src/python/m5/util/attrdict.py +++ b/src/python/m5/util/attrdict.py @@ -45,6 +45,12 @@ class attrdict(dict): return self.__delitem__(attr) return super(attrdict, self).__delattr__(attr) + def __getstate__(self): + return dict(self) + + def __setstate__(self, state): + self.update(state) + class multiattrdict(attrdict): """Wrap attrdict so that nested attribute accesses automatically create nested dictionaries.""" |