Skip to content

Commit 26109aa

Browse files
marconfusmjg59
authored andcommitted
Fix for environments where Crypto and pyaes are installed. (mjg59#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 mjg59#128
1 parent 00cc79d commit 26109aa

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

broadlink/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def __init__(self, host, mac, timeout=10):
167167
self.type = "Unknown"
168168
self.lock = threading.Lock()
169169

170-
if 'pyaes' in sys.modules:
170+
if 'pyaes' in globals():
171171
self.encrypt = self.encrypt_pyaes
172172
self.decrypt = self.decrypt_pyaes
173173
else:

0 commit comments

Comments
 (0)