sporkus / probe_accuracy_tests

GNU General Public License v3.0
139 stars 29 forks source link

fix(levelling): avoid unboundlocalerror for printers without qgl etc. #2

Closed bassco closed 2 years ago

bassco commented 2 years ago

I came across the following error when running the probe test on a V0 which does not have QGL or Z_TILT.

Homing
User has no leveling gcode. Please check printer.cfg [z_tilt] or [quad_gantry_level]
Skip leveling...
Traceback (most recent call last):
  File "/home/pi/probe_accuracy_tests/./probe_accuracy_test_suite.py", line 495, in <module>
    main(args)
  File "/home/pi/probe_accuracy_tests/./probe_accuracy_test_suite.py", line 41, in main
    level_bed()
  File "/home/pi/probe_accuracy_tests/./probe_accuracy_test_suite.py", line 287, in level_bed
    if (not leveled) or force:
UnboundLocalError: local variable 'leveled' referenced before assignment

Return before the assignment is tested, as we won't be running levelling in this scenario.