From 578c6c2ad2559c4c939c682151eeeaf3b847ab3e Mon Sep 17 00:00:00 2001 From: Iris <58442094+sleepyStick@users.noreply.github.com> Date: Mon, 30 Jun 2025 11:08:42 -0700 Subject: [PATCH] PYTHON-5423 Always use subprocess.run instead of subprocess.check_call or subprocess.call (#2412) --- hatch_build.py | 2 +- test/__init__.py | 2 +- test/asynchronous/__init__.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hatch_build.py b/hatch_build.py index 91315eb09..40271972d 100644 --- a/hatch_build.py +++ b/hatch_build.py @@ -19,7 +19,7 @@ class CustomHook(BuildHookInterface): here = Path(__file__).parent.resolve() sys.path.insert(0, str(here)) - subprocess.check_call([sys.executable, "_setup.py", "build_ext", "-i"]) + subprocess.run([sys.executable, "_setup.py", "build_ext", "-i"], check=True) # Ensure wheel is marked as binary and contains the binary files. build_data["infer_tag"] = True diff --git a/test/__init__.py b/test/__init__.py index e0646ce89..f143730d2 100644 --- a/test/__init__.py +++ b/test/__init__.py @@ -369,7 +369,7 @@ class ClientContext: if self._fips_enabled is not None: return self._fips_enabled try: - subprocess.check_call(["fips-mode-setup", "--is-enabled"]) + subprocess.run(["fips-mode-setup", "--is-enabled"], check=True) self._fips_enabled = True except (subprocess.SubprocessError, FileNotFoundError): self._fips_enabled = False diff --git a/test/asynchronous/__init__.py b/test/asynchronous/__init__.py index 48c9dc292..af473e7c6 100644 --- a/test/asynchronous/__init__.py +++ b/test/asynchronous/__init__.py @@ -369,7 +369,7 @@ class AsyncClientContext: if self._fips_enabled is not None: return self._fips_enabled try: - subprocess.check_call(["fips-mode-setup", "--is-enabled"]) + subprocess.run(["fips-mode-setup", "--is-enabled"], check=True) self._fips_enabled = True except (subprocess.SubprocessError, FileNotFoundError): self._fips_enabled = False