summaryrefslogtreecommitdiff
path: root/grc/base/Block.py
diff options
context:
space:
mode:
authorTom Rondeau2011-05-08 19:58:43 +0100
committerTom Rondeau2011-05-08 19:58:43 +0100
commita72bde633dda63c4471111894ca6b92a87318d5f (patch)
treec60e447e922b1a7076dd839ed8a94fcc9b665919 /grc/base/Block.py
parentbdd0bd405c2ea645395917c1abb91c964210c4d9 (diff)
parent207a2ae73bd5d6cab201bb57ed8db64fd54cfd90 (diff)
downloadgnuradio-a72bde633dda63c4471111894ca6b92a87318d5f.tar.gz
gnuradio-a72bde633dda63c4471111894ca6b92a87318d5f.tar.bz2
gnuradio-a72bde633dda63c4471111894ca6b92a87318d5f.zip
Merge branch 'master' into 8psk
Diffstat (limited to 'grc/base/Block.py')
-rw-r--r--grc/base/Block.py14
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)