From b149e1955c4b122ec443d67b30545c724f557773 Mon Sep 17 00:00:00 2001 From: Zak V Date: Tue, 24 Nov 2020 18:06:11 -0500 Subject: [PATCH] Fixed bug in unitconversions._All._import_all() where self.__all__ wasn't always changed from None to an empty list before appending things to it. --- labscript_utils/unitconversions/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/labscript_utils/unitconversions/__init__.py b/labscript_utils/unitconversions/__init__.py index da49116..a1b01d3 100644 --- a/labscript_utils/unitconversions/__init__.py +++ b/labscript_utils/unitconversions/__init__.py @@ -26,7 +26,6 @@ class _All(object): def __getitem__(self, ix): if self.__all__ is None: - self.__all__ = [] self._import_all() return self.__all__[ix] @@ -34,6 +33,8 @@ 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] 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