Resolve distutils deprecation warning

The distutils package is deprecated and slated for removal in
Python 3.12. Let's use shutil.which which is also recomended
by PEP 632: https://peps.python.org/pep-0632/#migration-advice

Closes-Bug: #2009229
Change-Id: Ibb2a9731449e765c4a56952a9f02679e9618778b
This commit is contained in:
Martin Kopec 2023-05-26 13:46:42 +02:00
parent cc49f4debb
commit a37b6abc8e

View File

@ -19,7 +19,6 @@
import argparse
import datetime
from distutils import spawn
import fnmatch
import io
import os
@ -76,7 +75,7 @@ def _dump_cmd(cmd):
def _find_cmd(cmd):
if not spawn.find_executable(cmd):
if not shutil.which(cmd):
print("*** %s not found: skipping" % cmd)
return False
return True