Use connection closing flag only for exception handling

Otherwise we kill the beforePrinterDisconnected gcode script...

See #1021
(cherry picked from commit 2fe956e)
This commit is contained in:
Gina Häußge 2015-08-13 17:22:26 +02:00
parent 7f10c317f1
commit cc14b77487

View file

@ -1322,7 +1322,7 @@ class MachineCom(object):
return line
def _readline(self):
if self._serial == None or self._connection_closing:
if self._serial is None:
return None
try:
@ -1642,7 +1642,7 @@ class MachineCom(object):
self._doSendWithoutChecksum(commandToSend)
def _doSendWithoutChecksum(self, cmd):
if self._serial is None or self._connection_closing:
if self._serial is None:
return
self._log("Send: %s" % cmd)