diff options
-rw-r--r-- | gnuradio-runtime/python/gnuradio/gr/hier_block2.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gnuradio-runtime/python/gnuradio/gr/hier_block2.py b/gnuradio-runtime/python/gnuradio/gr/hier_block2.py index 79bdd5abfc..cbb6e77392 100644 --- a/gnuradio-runtime/python/gnuradio/gr/hier_block2.py +++ b/gnuradio-runtime/python/gnuradio/gr/hier_block2.py @@ -75,11 +75,16 @@ class hier_block2(object): """ Pass-through member requests to the C++ object. """ - if not hasattr(self, "_impl"): + + try: + object.__getattribute__(self, "_impl") + except AttributeError as exception: raise RuntimeError( "{0}: invalid state -- did you forget to call {0}.__init__ in " - "a derived class?".format(self.__class__.__name__)) + "a derived class?".format(object.__getattribute__(self.__class__, "__name__"))) from exception + return getattr(self._impl, name) + # FIXME: these should really be implemented # in the original C++ class (gr_hier_block2), then they would all be inherited here |