summaryrefslogtreecommitdiff
path: root/buildstream/sandbox/_sandboxbwrap.py
diff options
context:
space:
mode:
Diffstat (limited to 'buildstream/sandbox/_sandboxbwrap.py')
-rw-r--r--buildstream/sandbox/_sandboxbwrap.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/buildstream/sandbox/_sandboxbwrap.py b/buildstream/sandbox/_sandboxbwrap.py
index fe429abe8..066932f5c 100644
--- a/buildstream/sandbox/_sandboxbwrap.py
+++ b/buildstream/sandbox/_sandboxbwrap.py
@@ -66,15 +66,15 @@ class SandboxBwrap(Sandbox):
cwd = self._get_work_directory(cwd=cwd)
env = self._get_environment(cwd=cwd, env=env)
+ # Convert single-string argument to a list
+ if isinstance(command, str):
+ command = [command]
+
if not self._has_command(command[0], env):
raise SandboxError("Staged artifacts do not provide command "
"'{}'".format(command[0]),
reason='missing-command')
- # We want command args as a list of strings
- if isinstance(command, str):
- command = [command]
-
# Create the mount map, this will tell us where
# each mount point needs to be mounted from and to
mount_map = MountMap(self, flags & SandboxFlags.ROOT_READ_ONLY)