From 8d04d3d8fd992ee304ea069df203fa7081ee54df Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Wed, 27 Sep 2017 10:05:11 -0400 Subject: [PATCH] gcode: Exit if a shutdown occurs while running in batch mode Signed-off-by: Kevin O'Connor --- klippy/gcode.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/klippy/gcode.py b/klippy/gcode.py index ccf78fac..49fed250 100644 --- a/klippy/gcode.py +++ b/klippy/gcode.py @@ -53,6 +53,8 @@ class GCodeParser: self.gcode_handlers = self.build_handlers(is_ready) if not is_ready: # Printer is shutdown (could be running in a background thread) + if self.is_fileinput: + self.printer.request_exit() return # Lookup printer components self.toolhead = self.printer.objects.get('toolhead')