From d28f84d7327298cbcb5974e3d6741870394675a6 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Tue, 23 Jun 2015 12:29:05 +0200 Subject: [PATCH] Abort attempts to connect if an error is thrown when connecting to the serial port This fixes an issue where thread.join() would be called from the current thread which fails. --- plugins/USBPrinting/PrinterConnection.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/USBPrinting/PrinterConnection.py b/plugins/USBPrinting/PrinterConnection.py index 19c5b5c07a..1d651516c5 100644 --- a/plugins/USBPrinting/PrinterConnection.py +++ b/plugins/USBPrinting/PrinterConnection.py @@ -173,6 +173,10 @@ class PrinterConnection(SignalEmitter): Logger.log("i", "Could not establish connection on %s: %s. Device is not arduino based." %(self._serial_port,str(e))) except Exception as e: Logger.log("i", "Could not establish connection on %s, unknown reasons. Device is not arduino based." % self._serial_port) + + if not self._serial or not programmer.serial: + self._is_connecting = False + return # If the programmer connected, we know its an atmega based version. Not all that usefull, but it does give some debugging information. for baud_rate in self._getBaudrateList(): # Cycle all baud rates (auto detect)