getAllDevices broken by cameraMicroEnable4.py
While making pyCameras independent from imrpy I noticed, that getAllDevices()
from utils is broken for me. While trying to scan for cameras implemented by cameraMicroEnable4.py
I get a KeyError
because on my system the environment variable SISODIR5
does not exist:
Traceback (most recent call last):
File "/home/kroeger/kroeger/Code/pyCameras/pyCameras/utils.py", line 317, in <module>
print(getAllDevices())
File "/home/kroeger/kroeger/Code/pyCameras/pyCameras/utils.py", line 88, in getAllDevices
implementation in listCameraImplementations()}
File "/home/kroeger/kroeger/Code/pyCameras/pyCameras/utils.py", line 64, in listCameraImplementations
classes.append(dynamic_import_class(modname + '.Camera'))
File "/home/kroeger/kroeger/Code/pyCameras/pyCameras/utils.py", line 44, in dynamic_import_class
mod = __import__(mod, fromlist=[cls])
File "/home/kroeger/kroeger/Code/pyCameras/pyCameras/cameraMicroEnable4.py", line 25, in <module>
sys.path.append(os.path.join(os.environ['SISODIR5'],
File "/usr/lib/python3.5/os.py", line 725, in __getitem__
raise KeyError(key) from None
KeyError: 'SISODIR5'
My suggestion would be to simply add a KeyError
catch to line 31 in cameraMicroEnable4.py
since not having the SISODIR5
environment variable would ultimately lead to being unable to import the necessary library.
I will go ahead and create a merge request for this. @melchert I think you wrote this file so I will mark you for that request...