From 926053da28c485228ad6e08c692e648a70b9a47e Mon Sep 17 00:00:00 2001 From: Luca Toniolo <10792599+grandixximo@users.noreply.github.com> Date: Sun, 1 Nov 2026 17:51:53 +0800 Subject: [PATCH] gremlin, qt5_graphics: a stopped parse now raises KeyboardInterrupt Since #4636 the gcodemodule lets the callback's own exception propagate instead of masking it as RuntimeError. An (AXIS,stop) program raises KeyboardInterrupt, which escaped these Exception-only handlers on file load. AXIS already catches it. Refs #2492. --- src/emc/usr_intf/gremlin/gremlin.py | 4 +++- src/emc/usr_intf/gremlin/qt5_graphics.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/emc/usr_intf/gremlin/gremlin.py b/src/emc/usr_intf/gremlin/gremlin.py index 9430bc953f7..9248a18699d 100755 --- a/src/emc/usr_intf/gremlin/gremlin.py +++ b/src/emc/usr_intf/gremlin/gremlin.py @@ -339,7 +339,9 @@ def load(self,filename = None): if result > gcode.MIN_ERROR: self.report_gcode_error(result, seq, filename) self.calculate_gcode_properties(canon) - except Exception as e: + except (Exception, KeyboardInterrupt) as e: + # (AXIS,stop) raises KeyboardInterrupt out of the parse, and it + # is no longer masked as RuntimeError (#2492). print (e) self.gcode_properties = None diff --git a/src/emc/usr_intf/gremlin/qt5_graphics.py b/src/emc/usr_intf/gremlin/qt5_graphics.py index 1bcae3db309..c442df4fd97 100644 --- a/src/emc/usr_intf/gremlin/qt5_graphics.py +++ b/src/emc/usr_intf/gremlin/qt5_graphics.py @@ -395,7 +395,9 @@ def load(self,filename = None): self.logger.set_depth(self.from_internal_linear_unit(self.get_foam_z()), self.from_internal_linear_unit(self.get_foam_w())) self.calculate_gcode_properties(canon) - except Exception as e: + except (Exception, KeyboardInterrupt) as e: + # (AXIS,stop) raises KeyboardInterrupt out of the parse, and it + # is no longer masked as RuntimeError (#2492). print (e) self.gcode_properties = None finally: