diff options
author | Steve Reinhardt <stever@eecs.umich.edu> | 2006-09-05 22:04:34 -0700 |
---|---|---|
committer | Steve Reinhardt <stever@eecs.umich.edu> | 2006-09-05 22:04:34 -0700 |
commit | 545cbec5f711ba36899e97fbcdcd26aa9a611c99 (patch) | |
tree | 304daaa81a177b5489f16364249fd5f5a0018a4e /src/python/m5/multidict.py | |
parent | 6c7a490c2b779ea45adfc5708f50aa16718582e4 (diff) | |
download | gem5-545cbec5f711ba36899e97fbcdcd26aa9a611c99.tar.xz |
Enable proxies (Self/Parent) for specifying ports.
Significant revamp of Port code.
Some cleanup of SimObject code too, particularly to
make the SimObject and MetaSimObject implementations of
__setattr__ more consistent.
Unproxy code split out of print_ini().
src/python/m5/multidict.py:
Make get() return None by default, to match semantics
of built-in dictionary objects.
--HG--
extra : convert_revision : db73b6cdd004a82a08b2402afd1e16544cb902a4
Diffstat (limited to 'src/python/m5/multidict.py')
-rw-r--r-- | src/python/m5/multidict.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/python/m5/multidict.py b/src/python/m5/multidict.py index 34fc3139b..b5cd700ef 100644 --- a/src/python/m5/multidict.py +++ b/src/python/m5/multidict.py @@ -29,7 +29,6 @@ __all__ = [ 'multidict' ] class multidict(object): - __nodefault = object() def __init__(self, parent = {}, **kwargs): self.local = dict(**kwargs) self.parent = parent @@ -102,14 +101,11 @@ class multidict(object): def values(self): return [ value for key,value in self.next() ] - def get(self, key, default=__nodefault): + def get(self, key, default=None): try: return self[key] except KeyError, e: - if default != self.__nodefault: - return default - else: - raise KeyError, e + return default def setdefault(self, key, default): try: |