diff options
author | marconfus <marconfus@users.noreply.github.com> | 2018-03-18T21·54+0100 |
---|---|---|
committer | Matthew Garrett <mjg59-github@srcf.ucam.org> | 2018-03-18T21·54-0700 |
commit | 26109aac67dc39b1c4dff3d1e971d463fe221847 (patch) | |
tree | e9e91541ef403525fc45db6739c06260a844daed | |
parent | 00cc79daee2e9ef2631474f94583389f4c0f2c27 (diff) |
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
-rw-r--r-- | broadlink/__init__.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/broadlink/__init__.py b/broadlink/__init__.py index 592acf4f86d0..e9c1307d8104 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: |