From 90cd23e279ca63b01350972a857b2aea4028d303 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Sat, 17 Jan 2026 20:44:07 +0100 Subject: [PATCH] [util] use function for custom Popen instead of an entire class with inheritance --- gallery_dl/util.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gallery_dl/util.py b/gallery_dl/util.py index 29330f40..1ccd3715 100644 --- a/gallery_dl/util.py +++ b/gallery_dl/util.py @@ -762,10 +762,9 @@ if EXECUTABLE and hasattr(sys, "_MEIPASS"): del orig - class Popen(subprocess.Popen): - def __init__(self, args, **kwargs): - kwargs["env"] = _popen_env - subprocess.Popen.__init__(self, args, **kwargs) + def Popen(args, **kwargs): + kwargs["env"] = _popen_env + return subprocess.Popen(args, **kwargs) else: Popen = subprocess.Popen