From 5053ae8cd3eab5f0c1a929c1836078f0aadeb6f1 Mon Sep 17 00:00:00 2001 From: Tat-Chee Wan (USM) Date: Fri, 10 Aug 2012 22:50:47 +0800 Subject: modified exception handler to remove extraneous error message when pyfantom is used Don't explicitly access usb module since it may not be loaded on Mac OS X. --- Host/nxt-gdb-server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Host/nxt-gdb-server.py b/Host/nxt-gdb-server.py index 197c27a..03a95d3 100755 --- a/Host/nxt-gdb-server.py +++ b/Host/nxt-gdb-server.py @@ -148,7 +148,7 @@ class NXTGDBServer: assert segno == prev_segno + 1, "segno = %s, prev_segno = %s" % (segno, prev_segno) prev_segno = segno msg += s - except usb.USBError as e: + except IOError as e: # Some pyusb are buggy, ignore some "errors". if e.args != ('No error', ): raise e @@ -198,7 +198,7 @@ class NXTGDBServer: for seg in segments: try: self.brick.sock.send (seg) - except usb.USBError as e: + except IOError as e: # Some pyusb are buggy, ignore some "errors". if e.args != ('No error', ): raise e -- cgit v1.2.3