Skip to content

Commit

Permalink
Fixed bug in AO.__init__() where failure to import a unit conversion …
Browse files Browse the repository at this point in the history
…class wasn't reported correctly, causing "AttributeError: 'NoneType' object has no attribute 'base_unit'".
  • Loading branch information
zakv committed Nov 24, 2020
1 parent 348bbeb commit e0a615a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions blacs/output_classes.py
Expand Up @@ -62,8 +62,8 @@ def __init__(self, hardware_name, connection_name, device_name, program_function
if cls is None or not isinstance(calib_params, dict) or cls.base_unit != default_units:
# log an error:
reason = ''
if calib_class is None:
reason = f'The unit conversion class {calib_class} could not be imported. Ensure it is available on the computer running BLACS.'
if cls is None:
reason = f'The unit conversion class {cls} could not be imported. Ensure it is available on the computer running BLACS.'
elif not isinstance(calib_params, dict):
reason = 'The parameters for the unit conversion class are not a dictionary. Check your connection table code for errors and recompile it'
elif cls.base_unit != default_units:
Expand Down

0 comments on commit e0a615a

Please sign in to comment.