From 1a9138f25efc4d0a32cc69d16a8e63d2852ee290 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Sun, 2 Feb 2025 15:01:17 +0100 Subject: [PATCH] [aes] handle errors during 'Cryptodome' import (#6906) --- gallery_dl/aes.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gallery_dl/aes.py b/gallery_dl/aes.py index 891104ab..6727541d 100644 --- a/gallery_dl/aes.py +++ b/gallery_dl/aes.py @@ -14,6 +14,13 @@ except ImportError: from Crypto.Cipher import AES as Cryptodome_AES except ImportError: Cryptodome_AES = None +except Exception as exc: + Cryptodome_AES = None + import logging + logging.getLogger("aes").warning( + "Error when trying to import 'Cryptodome' module (%s: %s)", + exc.__class__.__name__, exc) + del logging if Cryptodome_AES: