diff options
author | Tom Rondeau | 2011-05-08 19:58:43 +0100 |
---|---|---|
committer | Tom Rondeau | 2011-05-08 19:58:43 +0100 |
commit | a72bde633dda63c4471111894ca6b92a87318d5f (patch) | |
tree | c60e447e922b1a7076dd839ed8a94fcc9b665919 /grc/base/odict.py | |
parent | bdd0bd405c2ea645395917c1abb91c964210c4d9 (diff) | |
parent | 207a2ae73bd5d6cab201bb57ed8db64fd54cfd90 (diff) | |
download | gnuradio-a72bde633dda63c4471111894ca6b92a87318d5f.tar.gz gnuradio-a72bde633dda63c4471111894ca6b92a87318d5f.tar.bz2 gnuradio-a72bde633dda63c4471111894ca6b92a87318d5f.zip |
Merge branch 'master' into 8psk
Diffstat (limited to 'grc/base/odict.py')
-rw-r--r-- | grc/base/odict.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/grc/base/odict.py b/grc/base/odict.py index ac3cb2070..044d04ad7 100644 --- a/grc/base/odict.py +++ b/grc/base/odict.py @@ -1,5 +1,5 @@ """ -Copyright 2008, 2009 Free Software Foundation, Inc. +Copyright 2008-2011 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or @@ -55,7 +55,7 @@ class odict(DictMixin): @param val the value for the new entry """ index = (pos_key is None) and len(self._keys) or self._keys.index(pos_key) - assert key not in self._keys + if key in self._keys: raise KeyError('Cannot insert, key "%s" already exists'%str(key)) self._keys.insert(index+1, key) self._data[key] = val @@ -67,8 +67,8 @@ class odict(DictMixin): @param key the key for the new entry @param val the value for the new entry """ - index = (pos_key is not None) and self._keys.index(pos_key) or 0 - assert key not in self._keys + index = (pos_key is not None) and self._keys.index(pos_key) or 0 + if key in self._keys: raise KeyError('Cannot insert, key "%s" already exists'%str(key)) self._keys.insert(index, key) self._data[key] = val |