PYTHON-5423 Always use subprocess.run instead of subprocess.check_call or subprocess.call (#2412)

This commit is contained in:
Iris 2025-06-30 11:08:42 -07:00 committed by GitHub
parent ed26975926
commit 578c6c2ad2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View File

@ -19,7 +19,7 @@ class CustomHook(BuildHookInterface):
here = Path(__file__).parent.resolve() here = Path(__file__).parent.resolve()
sys.path.insert(0, str(here)) 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. # Ensure wheel is marked as binary and contains the binary files.
build_data["infer_tag"] = True build_data["infer_tag"] = True

View File

@ -369,7 +369,7 @@ class ClientContext:
if self._fips_enabled is not None: if self._fips_enabled is not None:
return self._fips_enabled return self._fips_enabled
try: try:
subprocess.check_call(["fips-mode-setup", "--is-enabled"]) subprocess.run(["fips-mode-setup", "--is-enabled"], check=True)
self._fips_enabled = True self._fips_enabled = True
except (subprocess.SubprocessError, FileNotFoundError): except (subprocess.SubprocessError, FileNotFoundError):
self._fips_enabled = False self._fips_enabled = False

View File

@ -369,7 +369,7 @@ class AsyncClientContext:
if self._fips_enabled is not None: if self._fips_enabled is not None:
return self._fips_enabled return self._fips_enabled
try: try:
subprocess.check_call(["fips-mode-setup", "--is-enabled"]) subprocess.run(["fips-mode-setup", "--is-enabled"], check=True)
self._fips_enabled = True self._fips_enabled = True
except (subprocess.SubprocessError, FileNotFoundError): except (subprocess.SubprocessError, FileNotFoundError):
self._fips_enabled = False self._fips_enabled = False