diff options
author | Mingli Yu <mingli.yu@windriver.com> | 2021-11-17 10:16:23 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-12-05 12:35:43 +0000 |
commit | 1b99e73828345cdaba9a0c14abbfdb234a654094 (patch) | |
tree | 082c7c7062eda6f067e83eb5ef3d7e96f18e287a /scripts/lib/wic/misc.py | |
parent | 5648b1612a76dd5fc93a106b7b323bc1ff41e34c (diff) | |
download | poky-1b99e73828345cdaba9a0c14abbfdb234a654094.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]
(From OE-Core rev: 17e2839001076f7fc56a7cf62196b087351083f1)
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 3966cbf5c8a2dbc3a4f0f3eefdbeeb83f522bf87)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/wic/misc.py')
-rw-r--r-- | scripts/lib/wic/misc.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/lib/wic/misc.py b/scripts/lib/wic/misc.py index 57c042c503..3e11822996 100644 --- a/scripts/lib/wic/misc.py +++ b/scripts/lib/wic/misc.py | |||
@@ -16,9 +16,9 @@ import logging | |||
16 | import os | 16 | import os |
17 | import re | 17 | import re |
18 | import subprocess | 18 | import subprocess |
19 | import shutil | ||
19 | 20 | ||
20 | from collections import defaultdict | 21 | from collections import defaultdict |
21 | from distutils import spawn | ||
22 | 22 | ||
23 | from wic import WicError | 23 | from wic import WicError |
24 | 24 | ||
@@ -122,7 +122,7 @@ def find_executable(cmd, paths): | |||
122 | if provided and "%s-native" % recipe in provided: | 122 | if provided and "%s-native" % recipe in provided: |
123 | return True | 123 | return True |
124 | 124 | ||
125 | return spawn.find_executable(cmd, paths) | 125 | return shutil.which(cmd, path=paths) |
126 | 126 | ||
127 | def exec_native_cmd(cmd_and_args, native_sysroot, pseudo=""): | 127 | def exec_native_cmd(cmd_and_args, native_sysroot, pseudo=""): |
128 | """ | 128 | """ |