aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2023-01-17 18:09:57 -0500
committerKevin O'Connor <kevin@koconnor.net>2023-01-17 18:11:57 -0500
commit86acee6e8bb5739ec8c9441108a4a17f980d65e3 (patch)
tree44ce8cd4c8f472c89a6d6929afaefc3e89771f9e /klippy/extras
parent4671cf2d0e3ec864e72766cb1f6e24f1a308f794 (diff)
downloadkutter-86acee6e8bb5739ec8c9441108a4a17f980d65e3.tar.gz
kutter-86acee6e8bb5739ec8c9441108a4a17f980d65e3.tar.xz
kutter-86acee6e8bb5739ec8c9441108a4a17f980d65e3.zip
z_tilt: Improve python3 compatibility
Sort using comparison on only first item in list to avoid greater/less than comparison of stepper objects (which causes an error on Python3). Reported by discourse user salbang. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras')
-rw-r--r--klippy/extras/z_tilt.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/klippy/extras/z_tilt.py b/klippy/extras/z_tilt.py
index 72c33831..49bafc4a 100644
--- a/klippy/extras/z_tilt.py
+++ b/klippy/extras/z_tilt.py
@@ -41,7 +41,7 @@ class ZAdjustHelper:
s.set_trapq(None)
# Move each z stepper (sorted from lowest to highest) until they match
positions = [(-a, s) for a, s in zip(adjustments, self.z_steppers)]
- positions.sort()
+ positions.sort(key=(lambda k: k[0]))
first_stepper_offset, first_stepper = positions[0]
z_low = curpos[2] - first_stepper_offset
for i in range(len(positions)-1):