mirror of
https://git.yoctoproject.org/meta-arm
synced 2026-07-16 15:57:19 +00:00
arm/fvp: Backport shlex.join from Python 3.8
721bec25 "arm/fvp: Join cli arguments in verbose logging" changed the
verbose output of FVPRunner to print the generated arguments using
shlex.join instead of as a list. However, this function is only
available in Python >= 3.8, whereas OE-core currently supports Python
3.6.
To fix this, backport its one-line implementation to a local function
shlex_join and update the call site.
Issue-Id: SCM-5314
Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Change-Id: I56cab9dddcd0a91272464be15742a6ee726dad41
Signed-off-by: Jon Mason <jon.mason@arm.com>
This commit is contained in:
@@ -70,6 +70,13 @@ class ConsolePortParser:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
# This function is backported from Python 3.8. Remove it and replace call sites
|
||||||
|
# with shlex.join once OE-core support for earlier Python versions is dropped.
|
||||||
|
def shlex_join(split_command):
|
||||||
|
"""Return a shell-escaped string from *split_command*."""
|
||||||
|
return ' '.join(shlex.quote(arg) for arg in split_command)
|
||||||
|
|
||||||
|
|
||||||
class FVPRunner:
|
class FVPRunner:
|
||||||
def __init__(self, logger):
|
def __init__(self, logger):
|
||||||
self._logger = logger
|
self._logger = logger
|
||||||
@@ -88,7 +95,7 @@ class FVPRunner:
|
|||||||
if name in os.environ:
|
if name in os.environ:
|
||||||
env[name] = os.environ[name]
|
env[name] = os.environ[name]
|
||||||
|
|
||||||
self._logger.debug(f"Constructed FVP call: {shlex.join(cli)}")
|
self._logger.debug(f"Constructed FVP call: {shlex_join(cli)}")
|
||||||
self._fvp_process = subprocess.Popen(
|
self._fvp_process = subprocess.Popen(
|
||||||
cli,
|
cli,
|
||||||
stdin=subprocess.DEVNULL, stdout=stdout, stderr=subprocess.STDOUT,
|
stdin=subprocess.DEVNULL, stdout=stdout, stderr=subprocess.STDOUT,
|
||||||
|
|||||||
Reference in New Issue
Block a user