Skip to content

Commit d5dfea7

Browse files
authored
Merge pull request #74 from zakv/unitconversions-import-bugfix
Fixed bug in unitconversions._All._import_all()
2 parents 9b76dcb + b149e19 commit d5dfea7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

labscript_utils/unitconversions/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,15 @@ class _All(object):
2626

2727
def __getitem__(self, ix):
2828
if self.__all__ is None:
29-
self.__all__ = []
3029
self._import_all()
3130
return self.__all__[ix]
3231

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

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy