diff options
author | Josh Blum | 2011-04-14 10:40:36 -0700 |
---|---|---|
committer | Josh Blum | 2011-04-14 10:40:36 -0700 |
commit | 66d7b23402dd9c366bb6c824d693274ccf3868db (patch) | |
tree | 72e262621ed774b16814d1b3756585346cb6434c /grc/base/Block.py | |
parent | 4cdd41c1046cef12601602bd38dc8ebf42d1550d (diff) | |
download | gnuradio-66d7b23402dd9c366bb6c824d693274ccf3868db.tar.gz gnuradio-66d7b23402dd9c366bb6c824d693274ccf3868db.tar.bz2 gnuradio-66d7b23402dd9c366bb6c824d693274ccf3868db.zip |
grc: replaced asserts in base subdirectory
Diffstat (limited to 'grc/base/Block.py')
-rw-r--r-- | grc/base/Block.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/grc/base/Block.py b/grc/base/Block.py index 42eb6b3fb..fe7ad3c2f 100644 --- a/grc/base/Block.py +++ b/grc/base/Block.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 @@ -92,8 +92,8 @@ class Block(Element): for param in map(lambda n: self.get_parent().get_parent().Param(block=self, n=n), params): key = param.get_key() #test against repeated keys - try: assert key not in self.get_param_keys() - except AssertionError: raise Exception, 'Key "%s" already exists in params'%key + if key in self.get_param_keys(): + raise Exception, 'Key "%s" already exists in params'%key #store the param self.get_params().append(param) #create the source objects @@ -101,8 +101,8 @@ class Block(Element): for source in map(lambda n: self.get_parent().get_parent().Port(block=self, n=n, dir='source'), sources): key = source.get_key() #test against repeated keys - try: assert key not in self.get_source_keys() - except AssertionError: raise Exception, 'Key "%s" already exists in sources'%key + if key in self.get_source_keys(): + raise Exception, 'Key "%s" already exists in sources'%key #store the port self.get_sources().append(source) #create the sink objects @@ -110,8 +110,8 @@ class Block(Element): for sink in map(lambda n: self.get_parent().get_parent().Port(block=self, n=n, dir='sink'), sinks): key = sink.get_key() #test against repeated keys - try: assert key not in self.get_sink_keys() - except AssertionError: raise Exception, 'Key "%s" already exists in sinks'%key + if key in self.get_sink_keys(): + raise Exception, 'Key "%s" already exists in sinks'%key #store the port self.get_sinks().append(sink) |