frontend: prefer to catch SerialException

It's a subclass of IOError, which we were catching first.
This commit is contained in:
Grigori Goronzy 2015-11-24 01:42:53 +01:00
parent d318384c25
commit 3a81844a17

View File

@ -139,11 +139,6 @@ class StcGal:
else:
self.protocol.disconnect()
return 0
except IOError as e:
sys.stdout.flush();
print("I/O error: %s" % e, file=sys.stderr)
self.protocol.disconnect()
return 1
except NameError as e:
sys.stdout.flush();
print("Option error: %s" % e, file=sys.stderr)
@ -162,6 +157,11 @@ class StcGal:
except serial.SerialException as e:
print("Serial port error: %s" % e, file=sys.stderr)
return 1
except IOError as e:
sys.stdout.flush();
print("I/O error: %s" % e, file=sys.stderr)
self.protocol.disconnect()
return 1
def cli():