Blob Blame History Raw
From 76e627cc579eca5aa95557a0c9bd4120094f3db3 Mon Sep 17 00:00:00 2001
From: Nickolay Olshevsky <o.nickolay@gmail.com>
Date: Wed, 26 Jul 2023 13:00:13 +0300
Subject: [PATCH] CLI tests: use shutil.which instead of find_executable.

---
 src/tests/cli_common.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/tests/cli_common.py b/src/tests/cli_common.py
index 12bf5d817..f8d7001fc 100644
--- a/src/tests/cli_common.py
+++ b/src/tests/cli_common.py
@@ -1,10 +1,10 @@
 import sys
-import distutils.spawn
 import random
 import string
 import logging
 import os
 import re
+import shutil
 from subprocess import Popen, PIPE
 
 RNP_ROOT = None
@@ -78,7 +78,7 @@ def file_text(path, encoding = CONSOLE_ENCODING):
         return f.read().decode(encoding).replace('\r\r', '\r')
 
 def find_utility(name, exitifnone = True):
-    path = distutils.spawn.find_executable(name)
+    path = shutil.which(name)
     if not path and exitifnone:
         logging.error('Cannot find utility {}. Exiting.'.format(name))
         sys.exit(1)