commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r3906 - gnuradio/branches/developers/eb/binstats/gnura


From: eb
Subject: [Commit-gnuradio] r3906 - gnuradio/branches/developers/eb/binstats/gnuradio-examples/python/usrp
Date: Mon, 30 Oct 2006 19:45:53 -0700 (MST)

Author: eb
Date: 2006-10-30 19:45:53 -0700 (Mon, 30 Oct 2006)
New Revision: 3906

Modified:
   
gnuradio/branches/developers/eb/binstats/gnuradio-examples/python/usrp/usrp_spectrum_sense.py
Log:
added try block for improved error diagnostics

Modified: 
gnuradio/branches/developers/eb/binstats/gnuradio-examples/python/usrp/usrp_spectrum_sense.py
===================================================================
--- 
gnuradio/branches/developers/eb/binstats/gnuradio-examples/python/usrp/usrp_spectrum_sense.py
       2006-10-31 02:43:09 UTC (rev 3905)
+++ 
gnuradio/branches/developers/eb/binstats/gnuradio-examples/python/usrp/usrp_spectrum_sense.py
       2006-10-31 02:45:53 UTC (rev 3906)
@@ -26,16 +26,23 @@
         the center frequency.  This method tunes the front end to the new 
center
         frequency, and returns the new frequency as its result.
         """
+        try:
+            # We use this try block so that if something goes wrong from here 
+            # down, at least we'll have a prayer of knowing what went wrong.
+            # Without this, you get a very mysterious:
+            #
+            #   terminate called after throwing an instance of 
'Swig::DirectorMethodException'
+            #   Aborted
+            #
+            # message on stderr.  Not exactly helpful ;)
 
-        #try:
-        #    new_freq = self.fg.set_next_freq()
-        #except Exception, e:
-        #    print "tune: Exception: ", e
+            new_freq = self.fg.set_next_freq()
+            return new_freq
 
-        new_freq = self.fg.set_next_freq()
-        return new_freq
-        
+        except Exception, e:
+            print "tune: Exception: ", e
 
+
 class parse_msg(object):
     def __init__(self, msg):
         self.center_freq = msg.arg1()





reply via email to

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