1
0
mirror of https://github.com/mjg59/python-broadlink.git synced 2024-11-10 18:00:12 +01:00

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
This commit is contained in:
marconfus 2018-03-18 22:54:17 +01:00 committed by Matthew Garrett
parent 00cc79daee
commit 26109aac67

View File

@ -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: