diff options
author | Mingli Yu <mingli.yu@windriver.com> | 2021-11-17 10:16:23 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-11-21 11:04:45 +0000 |
commit | 3966cbf5c8a2dbc3a4f0f3eefdbeeb83f522bf87 (patch) | |
tree | 59f9e2cd84b302e12b52debb463469e62ec72f59 /scripts/wic | |
parent | bc2e2ad6a9912ac36d9bbf6108f60d28eea3fc47 (diff) | |
download | openembedded-core-contrib-3966cbf5c8a2dbc3a4f0f3eefdbeeb83f522bf87.tar.gz |
wic: use shutil.which
Use shutil.which to find the executable instead to silence the below warning:
$ cat tmp/work/intel_x86_64-poky-linux/core-image-base/1.0-r5/temp/log.do_image_wic
[snip]
DEBUG: Executing shell function do_image_wic
/path/layers/oe-core/scripts/wic:27: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
from distutils import spawn
INFO: Creating image(s)...
[snip]
[RP: Added conversion for missed function reference]
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/wic')
-rwxr-xr-x | scripts/wic | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/wic b/scripts/wic index 57197c2048..4bcff8f79c 100755 --- a/scripts/wic +++ b/scripts/wic @@ -22,9 +22,9 @@ import sys import argparse import logging import subprocess +import shutil from collections import namedtuple -from distutils import spawn # External modules scripts_path = os.path.dirname(os.path.realpath(__file__)) @@ -47,7 +47,7 @@ if os.environ.get('SDKTARGETSYSROOT'): break sdkroot = os.path.dirname(sdkroot) -bitbake_exe = spawn.find_executable('bitbake') +bitbake_exe = shutil.which('bitbake') if bitbake_exe: bitbake_path = scriptpath.add_bitbake_lib_path() import bb |