From 3deb5a413dc7b7ae17cf83b240192588b6eaa1c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Tue, 21 Oct 2025 12:06:50 +0200 Subject: [PATCH] improve arguments for relative '__import__()' using None for 'fromlist' is slightly faster than an empty tuple --- gallery_dl/downloader/__init__.py | 2 +- gallery_dl/extractor/__init__.py | 2 +- gallery_dl/postprocessor/__init__.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gallery_dl/downloader/__init__.py b/gallery_dl/downloader/__init__.py index e1b936e4..79dc5cb1 100644 --- a/gallery_dl/downloader/__init__.py +++ b/gallery_dl/downloader/__init__.py @@ -27,7 +27,7 @@ def find(scheme): scheme = "http" if scheme in modules: # prevent unwanted imports try: - module = __import__(scheme, globals(), None, (), 1) + module = __import__(scheme, globals(), None, None, 1) except ImportError: pass else: diff --git a/gallery_dl/extractor/__init__.py b/gallery_dl/extractor/__init__.py index c7e33c80..2f2c0f5e 100644 --- a/gallery_dl/extractor/__init__.py +++ b/gallery_dl/extractor/__init__.py @@ -299,7 +299,7 @@ def _list_classes(): def _modules_internal(): globals_ = globals() for module_name in modules: - yield __import__(module_name, globals_, None, (), 1) + yield __import__(module_name, globals_, None, None, 1) def _modules_path(path, files): diff --git a/gallery_dl/postprocessor/__init__.py b/gallery_dl/postprocessor/__init__.py index 1a4ce56e..6da03303 100644 --- a/gallery_dl/postprocessor/__init__.py +++ b/gallery_dl/postprocessor/__init__.py @@ -33,7 +33,7 @@ def find(name): cls = None if name in modules: # prevent unwanted imports try: - module = __import__(name, globals(), None, (), 1) + module = __import__(name, globals(), None, None, 1) except ImportError: pass else: