Fix f-string, use function instead of lambda

Co-authored-by: Nicola Soranzo <nicola.soranzo@gmail.com>
This commit is contained in:
Marius van den Beek
2022-06-20 07:41:47 +02:00
committed by mvdbeek
co-authored by Nicola Soranzo
parent 60b6c47b40
commit 13c34e974d
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -82,7 +82,9 @@ try:
shlex_join = shlex.join # type: ignore[attr-defined]
except AttributeError:
# Python < 3.8
shlex_join = lambda split_command: " ".join(map(shlex.quote, split_command)) # noqa: E731
def shlex_join(split_command):
return " ".join(map(shlex.quote, split_command))
inflector = Inflector()
+1 -1
View File
@@ -335,7 +335,7 @@ class BaseKubernetesIntegrationTestCase(BaseJobEnvironmentIntegrationTestCase, M
if allow_wait and "is waiting to start" in p.stderr:
return None
raise Exception(
f"Command '{shlex_join}' failed with exit code: {p.returncode}.\nstdout: {p.stdout}\nstderr: {p.stderr}"
f"Command '{shlex_join(log_cmd)}' failed with exit code: {p.returncode}.\nstdout: {p.stdout}\nstderr: {p.stderr}"
)
return p.stdout