diff options
author | Arjen Hiemstra <a.hiemstra@ultimaker.com> | 2015-06-23 13:29:05 +0300 |
---|---|---|
committer | Arjen Hiemstra <a.hiemstra@ultimaker.com> | 2015-06-23 13:29:05 +0300 |
commit | d28f84d7327298cbcb5974e3d6741870394675a6 (patch) | |
tree | 67107217a0af556e180a9a9db6ab6bdf1e47cc78 /plugins/USBPrinting/PrinterConnection.py | |
parent | 8a63b8d110d5925a127cd1d2b3659428dc126af9 (diff) |
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.
Diffstat (limited to 'plugins/USBPrinting/PrinterConnection.py')
-rw-r--r-- | plugins/USBPrinting/PrinterConnection.py | 4 |
1 files changed, 4 insertions, 0 deletions
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) |