From 447625bffd3cbb65ec729c2d2a4673488477df81 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Fri, 19 Apr 2024 16:18:46 +0500 Subject: [PATCH] fix failing test in util.selector.format with imperial_length MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/ifcopenshell-python/ifcopenshell/util/selector.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ifcopenshell-python/ifcopenshell/util/selector.py b/src/ifcopenshell-python/ifcopenshell/util/selector.py index dd48eeb599..15ba9e0762 100644 --- a/src/ifcopenshell-python/ifcopenshell/util/selector.py +++ b/src/ifcopenshell-python/ifcopenshell/util/selector.py @@ -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