Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion labscript_utils/unitconversions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@ class _All(object):

def __getitem__(self, ix):
if self.__all__ is None:
self.__all__ = []
self._import_all()
return self.__all__[ix]

def _import_all(self):
"""imports all unit conversion classes in module within this subpackage into
this module's globals. This is used only for backward compatibility with unit
conversion classes that were not specified with a fully qualified name"""
if self.__all__ is None:
self.__all__ = []
for filename in os.listdir(os.path.split(__file__)[0]):
if filename.endswith('.py') and filename != '__init__.py':
module = filename[:-3]
Expand Down