Assign the default cable length unit when not present

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.
This commit is contained in:
KV 2020-12-26 04:46:21 +01:00
parent 606ddbf977
commit b294033c88

View File

@ -228,7 +228,7 @@ class Cable:
self.length_unit = u self.length_unit = u
elif not any(isinstance(self.length, t) for t in [int, float]): elif not any(isinstance(self.length, t) for t in [int, float]):
raise Exception(f'Cable {self.name} length has a non-numeric value') 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.length_unit = 'm'
self.connections = [] self.connections = []