From da568412908c8daae7e57565ce446e81fd0140a5 Mon Sep 17 00:00:00 2001 From: kvid Date: Tue, 29 Dec 2020 13:31:55 +0100 Subject: [PATCH] Assign the default cable length unit when not present (#206) Bug: Failing to assign the default cable length unit when not present. It was introduced in #198. Fix: Test the correct cable attribute. This fix solves issue #205. --- src/wireviz/DataClasses.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wireviz/DataClasses.py b/src/wireviz/DataClasses.py index 1607d3b..fac6ab5 100644 --- a/src/wireviz/DataClasses.py +++ b/src/wireviz/DataClasses.py @@ -228,7 +228,7 @@ class Cable: self.length_unit = u elif not any(isinstance(self.length, t) for t in [int, float]): raise Exception(f'Cable {self.name} length has a non-numeric value') - elif self.gauge_unit is None: + elif self.length_unit is None: self.length_unit = 'm' self.connections = []