From 4fc36efcf2f763aff814fdfa65807c3df590196e Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Sat, 17 Jul 2021 17:47:51 +0200 Subject: [PATCH] pbuilder-dist: use shutil.which instead of distutils.spawn.find_executable() to save a dependency LP: #1936697 Signed-off-by: Mattia Rizzolo --- pbuilder-dist | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pbuilder-dist b/pbuilder-dist index 56e5a5e..dde56c6 100755 --- a/pbuilder-dist +++ b/pbuilder-dist @@ -29,11 +29,11 @@ # configurations. For example, a symlink called pbuilder-hardy will assume # that the target distribution is always meant to be Ubuntu Hardy. -import distutils.spawn import os import os.path -import subprocess import sys +import subprocess +import shutil import debian.deb822 from contextlib import suppress @@ -449,7 +449,7 @@ def main(): if len(parts) > 2: requested_arch = parts[2] elif len(args) > 0: - if distutils.spawn.find_executable('arch-test'): + if shutil.which('arch-test') is not None: if subprocess.run( ['arch-test', args[0]], stdout=subprocess.DEVNULL).returncode == 0: