From ef13cbecfd27b555a93ff15b607cfa46b17242bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Wed, 12 Nov 2014 11:50:58 +0100 Subject: [PATCH] Do not delete lines from the send queue upon cancel that were already prepared (got a line number) --- src/octoprint/comm/protocol/reprap/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/octoprint/comm/protocol/reprap/__init__.py b/src/octoprint/comm/protocol/reprap/__init__.py index 1597c6051..1e4ceca02 100644 --- a/src/octoprint/comm/protocol/reprap/__init__.py +++ b/src/octoprint/comm/protocol/reprap/__init__.py @@ -280,7 +280,7 @@ class RepRapProtocol(Protocol): Protocol.cancel_print(self) with self._fill_queue_mutex: - self._send_queue.clear(matcher=lambda entry: entry is not None and entry.command is not None and hasattr(entry.command, "progress") and entry.command.progress is not None) + self._send_queue.clear(matcher=lambda entry: entry is not None and entry.command is not None and hasattr(entry.command, "progress") and entry.command.progress is not None and (not hasattr(entry, "prepared") or entry.prepared is None)) def init_sd(self): Protocol.init_sd(self)