Catch OSError exception when accessing serial ports on OSX

This commit is contained in:
Dan
2014-03-11 10:24:17 +08:00
parent eba408445c
commit ccd35e9019

2
Arduino/arduino.py Normal file → Executable file
View File

@@ -66,7 +66,7 @@ def find_port(baud, timeout):
log.debug('Found {0}, testing...'.format(p))
try:
sr = serial.Serial(p, baud, timeout=timeout)
except serial.serialutil.SerialException as e:
except (serial.serialutil.SerialException, OSError) as e:
log.debug(str(e))
continue
time.sleep(2)