]> jfr.im git - yt-dlp.git/commitdiff
[dependencies/Cryptodome] Fix `__bool__`
authorpukkandan <redacted>
Sun, 12 Mar 2023 23:49:13 +0000 (05:19 +0530)
committerpukkandan <redacted>
Sun, 12 Mar 2023 23:51:43 +0000 (05:21 +0530)
Bug in 65f6e807804d2af5e00f2aecd72bfc43af19324a

yt_dlp/dependencies/Cryptodome.py

index 74ab6575ce284e3a86580d27133563cca983d91f..2cfa4c95223bd1adcd778ff303cc387380b3eeb2 100644 (file)
@@ -1,4 +1,4 @@
-import types
+from ..compat.compat_utils import passthrough_module
 
 try:
     import Cryptodome as _parent
@@ -6,9 +6,11 @@
     try:
         import Crypto as _parent
     except (ImportError, SyntaxError):  # Old Crypto gives SyntaxError in newer Python
-        _parent = types.ModuleType('no_Cryptodome')
+        _parent = passthrough_module(__name__, 'no_Cryptodome')
         __bool__ = lambda: False
 
+del passthrough_module
+
 __version__ = ''
 AES = PKCS1_v1_5 = Blowfish = PKCS1_OAEP = SHA1 = CMAC = RSA = None
 try: