fix failing test in util.selector.format with imperial_length

the error is below, not sure how I haven't noticed it before 🤔

assert subject.format('imperial_length(1, 1)') == "1'"

>               raise VisitError(tree.data, tree, e)
E               lark.exceptions.VisitError: Error trying to process rule "imperial_length":
E
E               cannot access local variable 'output_unit' where it is not associated with a value
This commit is contained in:
Andrej730
2024-04-19 16:18:46 +05:00
parent 25edaa9b89
commit 447625bffd
@@ -233,7 +233,7 @@ class FormatTransformer(lark.Transformer):
def imperial_length(self, args):
if len(args) == 2:
input_unit = "foot"
input_unit, output_unit = "foot", "foot"
value, precision = args
else:
value, precision, input_unit, output_unit = args