From a37b6abc8ecab1a32593aecdf8f74d54f3c4adb1 Mon Sep 17 00:00:00 2001 From: Martin Kopec Date: Fri, 26 May 2023 13:46:42 +0200 Subject: [PATCH] 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 --- tools/worlddump.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/worlddump.py b/tools/worlddump.py index e2921737db..aadd33b634 100755 --- a/tools/worlddump.py +++ b/tools/worlddump.py @@ -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