Flush stdout in some more error cases
This commit is contained in:
parent
ed28c8ef89
commit
52b346ebfc
@ -2854,13 +2854,16 @@ class StcGal:
|
|||||||
def run(self):
|
def run(self):
|
||||||
try: self.protocol.connect()
|
try: self.protocol.connect()
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
|
sys.stdout.flush();
|
||||||
print("interrupted")
|
print("interrupted")
|
||||||
return 2
|
return 2
|
||||||
except (StcFramingException, StcProtocolException) as e:
|
except (StcFramingException, StcProtocolException) as e:
|
||||||
|
sys.stdout.flush();
|
||||||
print("Protocol error: %s" % e, file=sys.stderr)
|
print("Protocol error: %s" % e, file=sys.stderr)
|
||||||
self.protocol.disconnect()
|
self.protocol.disconnect()
|
||||||
return 1
|
return 1
|
||||||
except serial.SerialException as e:
|
except serial.SerialException as e:
|
||||||
|
sys.stdout.flush();
|
||||||
print("Serial port error: %s" % e, file=sys.stderr)
|
print("Serial port error: %s" % e, file=sys.stderr)
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user