From 3cc9d67b704b095376239bdfe396951ce51d9dc4 Mon Sep 17 00:00:00 2001 From: Victoria Shepard <5807469+demonolock@users.noreply.github.com> Date: Mon, 29 May 2023 12:23:38 +0200 Subject: [PATCH] Replace deprecated distutils find_executable on shutil which (#82) Co-authored-by: v.shepard --- testgres/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/testgres/utils.py b/testgres/utils.py index 4d99c69d..d8006d08 100644 --- a/testgres/utils.py +++ b/testgres/utils.py @@ -12,7 +12,10 @@ from contextlib import contextmanager from packaging.version import Version -from distutils.spawn import find_executable +try: + from shutil import which as find_executable +except ImportError: + from distutils.spawn import find_executable from six import iteritems from .config import testgres_config