From 496985ee670f58bf955f9c629fb18f0591a64845 Mon Sep 17 00:00:00 2001 From: jstilley Date: Mon, 3 Jun 2024 16:47:45 -0700 Subject: [PATCH] Removing reference to distutils --- armi/bookkeeping/db/tests/test_database3.py | 6 +++--- armi/tests/test_mpiFeatures.py | 6 +++--- armi/tests/test_mpiParameters.py | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/armi/bookkeeping/db/tests/test_database3.py b/armi/bookkeeping/db/tests/test_database3.py index d7c4eca7d..f39e3015b 100644 --- a/armi/bookkeeping/db/tests/test_database3.py +++ b/armi/bookkeeping/db/tests/test_database3.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. """Tests for the Database3 class.""" -from distutils.spawn import find_executable +import shutil import subprocess import unittest @@ -31,9 +31,9 @@ # determine if this is a parallel run, and git is installed GIT_EXE = None -if find_executable("git") is not None: +if shutil.which("git") is not None: GIT_EXE = "git" -elif find_executable("git.exe") is not None: +elif shutil.which("git.exe") is not None: GIT_EXE = "git.exe" diff --git a/armi/tests/test_mpiFeatures.py b/armi/tests/test_mpiFeatures.py index abf16fa10..9a1c209c0 100644 --- a/armi/tests/test_mpiFeatures.py +++ b/armi/tests/test_mpiFeatures.py @@ -24,9 +24,9 @@ or mpiexec.exe -n 2 python -m pytest armi/tests/test_mpiFeatures.py """ -from distutils.spawn import find_executable from unittest.mock import patch import os +import shutil import unittest from armi import context @@ -47,9 +47,9 @@ # determine if this is a parallel run, and MPI is installed MPI_EXE = None -if find_executable("mpiexec.exe") is not None: +if shutil.which("mpiexec.exe") is not None: MPI_EXE = "mpiexec.exe" -elif find_executable("mpiexec") is not None: +elif shutil.which("mpiexec") is not None: MPI_EXE = "mpiexec" MPI_COMM = context.MPI_COMM diff --git a/armi/tests/test_mpiParameters.py b/armi/tests/test_mpiParameters.py index a5a6bd5e9..4754a7690 100644 --- a/armi/tests/test_mpiParameters.py +++ b/armi/tests/test_mpiParameters.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. """Tests of the MPI portion of the Parameters class.""" -from distutils.spawn import find_executable +import shutil import unittest from armi import context @@ -21,9 +21,9 @@ # determine if this is a parallel run, and MPI is installed MPI_EXE = None -if find_executable("mpiexec.exe") is not None: +if shutil.which("mpiexec.exe") is not None: MPI_EXE = "mpiexec.exe" -elif find_executable("mpiexec") is not None: +elif shutil.which("mpiexec") is not None: MPI_EXE = "mpiexec"