From 8aaf285ac5eca73853300d38c8121e9c2757fef2 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sun, 13 Oct 2013 12:38:26 +0200 Subject: Python exception handling from muggenhor --- Tools/px_uploader.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Tools/px_uploader.py') diff --git a/Tools/px_uploader.py b/Tools/px_uploader.py index 64af672a3..a2d7d371d 100755 --- a/Tools/px_uploader.py +++ b/Tools/px_uploader.py @@ -430,7 +430,7 @@ while True: # Windows, don't open POSIX ports if not "/" in port: up = uploader(port, args.baud) - except: + except Exception: # open failed, rate-limit our attempts time.sleep(0.05) @@ -443,7 +443,7 @@ while True: up.identify() print("Found board %x,%x bootloader rev %x on %s" % (up.board_type, up.board_rev, up.bl_rev, port)) - except: + except Exception: # most probably a timeout talking to the port, no bootloader, try to reboot the board print("attempting reboot on %s..." % port) up.send_reboot() -- cgit v1.2.3