From 15f7d458bc9189bcfd48c9b82db8e80632406c21 Mon Sep 17 00:00:00 2001 From: Brandon Nance Date: Thu, 21 Dec 2023 14:14:29 -0500 Subject: [PATCH] fix gcode ref --- klippy/klippy.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/klippy/klippy.py b/klippy/klippy.py index 9f34677ce..0a5500fb5 100644 --- a/klippy/klippy.py +++ b/klippy/klippy.py @@ -382,13 +382,11 @@ def wait_while(self, condition_cb): waits until callback returns False (or is interrupted, or printer shuts down) """ - counter = self.gcode.get_interrupt_counter() + gcode = self.lookup_object("gcode") + counter = gcode.get_interrupt_counter() eventtime = self.reactor.monotonic() while condition_cb(eventtime): - if ( - self.is_shutdown() - or counter != self.gcode.get_interrupt_counter() - ): + if self.is_shutdown() or counter != gcode.get_interrupt_counter(): return eventtime = self.reactor.pause(eventtime + 1.0)