diff options
author | Brennan Ashton <bashton@brennanashton.com> | 2018-11-14 17:53:22 -0800 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2018-11-15 15:44:05 -0800 |
commit | 2f66412afaca4a42319c666958c89827edd8f2f3 (patch) | |
tree | f82482c09d4885fcd8b1a279484d5770767a32aa /gnuradio-runtime/python/gnuradio/ctrlport/monitor.py | |
parent | 39b74849d939456a0d1e4aa534e9f829e742ba63 (diff) |
gr-runtime: Improve exception handling in ControlPort Monitor
Diffstat (limited to 'gnuradio-runtime/python/gnuradio/ctrlport/monitor.py')
-rw-r--r-- | gnuradio-runtime/python/gnuradio/ctrlport/monitor.py | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/gnuradio-runtime/python/gnuradio/ctrlport/monitor.py b/gnuradio-runtime/python/gnuradio/ctrlport/monitor.py index 87d6cb9e7f..0cc05be63e 100644 --- a/gnuradio-runtime/python/gnuradio/ctrlport/monitor.py +++ b/gnuradio-runtime/python/gnuradio/ctrlport/monitor.py @@ -33,15 +33,12 @@ class monitor(object): self.tool = tool atexit.register(self.shutdown) - try: - # setup export prefs - gr.prefs().singleton().set_bool("ControlPort","on",True); - if(tool == "gr-perf-monitorx"): - gr.prefs().singleton().set_bool("ControlPort","edges_list",True); - gr.prefs().singleton().set_bool("PerfCounters","on",True); - gr.prefs().singleton().set_bool("PerfCounters","export",True); - except: - print("no support for gr.prefs setting") + # setup export prefs + gr.prefs().singleton().set_bool("ControlPort","on",True); + if(tool == "gr-perf-monitorx"): + gr.prefs().singleton().set_bool("ControlPort","edges_list",True); + gr.prefs().singleton().set_bool("PerfCounters","on",True); + gr.prefs().singleton().set_bool("PerfCounters","export",True); def __del__(self): if(self.started): @@ -57,7 +54,7 @@ class monitor(object): print("running: %s"%(str(cmd))) self.proc = subprocess.Popen(cmd); self.started = True - except: + except (ValueError, OSError): self.proc = None print("failed to to start ControlPort Monitor on specified port") |