commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r10908 - gnuradio/trunk/gnuradio-core/src/python/gnura


From: jcorgan
Subject: [Commit-gnuradio] r10908 - gnuradio/trunk/gnuradio-core/src/python/gnuradio/gr
Date: Fri, 24 Apr 2009 20:57:27 -0600 (MDT)

Author: jcorgan
Date: 2009-04-24 20:57:27 -0600 (Fri, 24 Apr 2009)
New Revision: 10908

Modified:
   gnuradio/trunk/gnuradio-core/src/python/gnuradio/gr/hier_block2.py
   gnuradio/trunk/gnuradio-core/src/python/gnuradio/gr/top_block.py
Log:
Generate more informative error message than recursion error

Modified: gnuradio/trunk/gnuradio-core/src/python/gnuradio/gr/hier_block2.py
===================================================================
--- gnuradio/trunk/gnuradio-core/src/python/gnuradio/gr/hier_block2.py  
2009-04-25 02:25:25 UTC (rev 10907)
+++ gnuradio/trunk/gnuradio-core/src/python/gnuradio/gr/hier_block2.py  
2009-04-25 02:57:27 UTC (rev 10908)
@@ -45,6 +45,8 @@
         """
         Pass-through member requests to the C++ object.
         """
+        if not hasattr(self, "_hb"):
+            raise RuntimeError("hier_block2: invalid state--did you forget to 
call gr.hier_block2.__init__ in a derived class?")
        return getattr(self._hb, name)
 
     def connect(self, *points):

Modified: gnuradio/trunk/gnuradio-core/src/python/gnuradio/gr/top_block.py
===================================================================
--- gnuradio/trunk/gnuradio-core/src/python/gnuradio/gr/top_block.py    
2009-04-25 02:25:25 UTC (rev 10907)
+++ gnuradio/trunk/gnuradio-core/src/python/gnuradio/gr/top_block.py    
2009-04-25 02:57:27 UTC (rev 10908)
@@ -89,6 +89,8 @@
        self._tb = top_block_swig(name)
 
     def __getattr__(self, name):
+        if not hasattr(self, "_tb"):
+            raise RuntimeError("top_block: invalid state--did you forget to 
call gr.top_block.__init__ in a derived class?")
        return getattr(self._tb, name)
 
     def start(self):





reply via email to

[Prev in Thread] Current Thread [Next in Thread]