From b51c1eceac15e33b2cf55475f10900ffd1708170 Mon Sep 17 00:00:00 2001 From: npt-1707 Date: Mon, 18 May 2026 06:36:05 +0800 Subject: [PATCH] Pkgs/rife-ncnn-vs/Lib/site-packages/pip/_vendor/distlib/_backport/shutil.py: Convert shutil._call_external_zip to use subprocess rather than distutils.spawn. --- .../pip/_vendor/distlib/_backport/shutil.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Pkgs/rife-ncnn-vs/Lib/site-packages/pip/_vendor/distlib/_backport/shutil.py b/Pkgs/rife-ncnn-vs/Lib/site-packages/pip/_vendor/distlib/_backport/shutil.py index 10ed3625..2e5b8c96 100644 --- a/Pkgs/rife-ncnn-vs/Lib/site-packages/pip/_vendor/distlib/_backport/shutil.py +++ b/Pkgs/rife-ncnn-vs/Lib/site-packages/pip/_vendor/distlib/_backport/shutil.py @@ -435,17 +435,21 @@ def _set_uid_gid(tarinfo): return archive_name -def _call_external_zip(base_dir, zip_filename, verbose=False, dry_run=False): +def _call_external_zip(base_dir, zip_filename, verbose, dry_run, logger): # XXX see if we want to keep an external call here if verbose: zipoptions = "-r" else: zipoptions = "-rq" - from distutils.errors import DistutilsExecError - from distutils.spawn import spawn + cmd = ["zip", zipoptions, zip_filename, base_dir] + if logger is not None: + logger.info(' '.join(cmd)) + if dry_run: + return + import subprocess try: - spawn(["zip", zipoptions, zip_filename, base_dir], dry_run=dry_run) - except DistutilsExecError: + subprocess.check_call(cmd) + except subprocess.CalledProcessError: # XXX really should distinguish between "couldn't find # external 'zip' command" and "zip failed". raise ExecError("unable to create zip file '%s': " @@ -478,7 +482,7 @@ def _make_zipfile(base_name, base_dir, verbose=0, dry_run=0, logger=None): zipfile = None if zipfile is None: - _call_external_zip(base_dir, zip_filename, verbose, dry_run) + _call_external_zip(base_dir, zip_filename, verbose, dry_run, logger) else: if logger is not None: logger.info("creating '%s' and adding '%s' to it",