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.
This commit is contained in:
kvid 2020-12-29 13:31:55 +01:00 committed by GitHub
parent 606ddbf977
commit da56841290
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 = []