frontend: fix disconnect when autodetection fails

We don't know the protocol version so we can't actually disconnect,
just skip it.
This commit is contained in:
Grigori Goronzy 2021-01-09 16:50:08 +01:00
parent 9900e3088d
commit 761c68e469

View File

@ -181,7 +181,8 @@ class StcGal:
except (StcFramingException, StcProtocolException) as ex:
sys.stdout.flush()
print("Protocol error: %s" % ex, file=sys.stderr)
self.protocol.disconnect()
if not isinstance(self.protocol, StcAutoProtocol):
self.protocol.disconnect()
return 1
except serial.SerialException as ex:
sys.stdout.flush()