From 26109aac67dc39b1c4dff3d1e971d463fe221847 Mon Sep 17 00:00:00 2001 From: marconfus Date: Sun, 18 Mar 2018 22:54:17 +0100 Subject: [PATCH] Fix for environments where Crypto and pyaes are installed. (#151) If both Crypto and pyaes are installed 'pyaes' is in sys.modules(), but as it is not imported (see top) it's not available. Fix for #128 --- broadlink/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/broadlink/__init__.py b/broadlink/__init__.py index 592acf4f8..e9c1307d8 100644 --- a/broadlink/__init__.py +++ b/broadlink/__init__.py @@ -167,7 +167,7 @@ class device: self.type = "Unknown" self.lock = threading.Lock() - if 'pyaes' in sys.modules: + if 'pyaes' in globals(): self.encrypt = self.encrypt_pyaes self.decrypt = self.decrypt_pyaes else: