summaryrefslogtreecommitdiff
path: root/grc/base/odict.py
diff options
context:
space:
mode:
authorTom Rondeau2011-06-05 15:36:47 -0400
committerTom Rondeau2011-06-05 15:36:47 -0400
commit233f960474f86bc8cc519ce7257b29d8615c4000 (patch)
tree1a4c846119a01a5a195a9e9ee5b854384b0b6535 /grc/base/odict.py
parent024c79a7fb13c08bae7b97079a245f711ecf12a7 (diff)
parenta23a0a46c3bf446cbe09d71bc8e10b061256ef56 (diff)
downloadgnuradio-233f960474f86bc8cc519ce7257b29d8615c4000.tar.gz
gnuradio-233f960474f86bc8cc519ce7257b29d8615c4000.tar.bz2
gnuradio-233f960474f86bc8cc519ce7257b29d8615c4000.zip
Merge branch 'master' into turbo
Diffstat (limited to 'grc/base/odict.py')
-rw-r--r--grc/base/odict.py8
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