From 08adecd226b4d712eb900b1768a7a96294a89c20 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Fri, 4 Sep 2020 11:49:43 -0400 Subject: homing: Prefer printer.command_error() instead of homing.CommandError() Update callers to use the printer.command_error reference instead of directly using homing.CommandError() when raising or catching errors. Signed-off-by: Kevin O'Connor --- klippy/kinematics/extruder.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'klippy/kinematics/extruder.py') diff --git a/klippy/kinematics/extruder.py b/klippy/kinematics/extruder.py index 302c4eed..a931c896 100644 --- a/klippy/kinematics/extruder.py +++ b/klippy/kinematics/extruder.py @@ -4,7 +4,7 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. import math, logging -import stepper, homing, chelper +import stepper, chelper class PrinterExtruder: def __init__(self, config, extruder_num): @@ -214,6 +214,8 @@ class PrinterExtruder: # Dummy extruder class used when a printer has no extruder at all class DummyExtruder: + def __init__(self, printer): + self.printer = printer def update_move_time(self, flush_time): pass def check_move(self, move): @@ -223,7 +225,7 @@ class DummyExtruder: def get_name(self): return "" def get_heater(self): - raise homing.CommandError("Extruder not configured") + raise self.printer.command_error("Extruder not configured") def add_printer_objects(config): printer = config.get_printer() -- cgit v1.2.3-70-g09d2