diff --git a/lib/galaxy/util/__init__.py b/lib/galaxy/util/__init__.py index 401942f9b29..119e3f15ee0 100644 --- a/lib/galaxy/util/__init__.py +++ b/lib/galaxy/util/__init__.py @@ -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() diff --git a/test/integration/test_kubernetes_runner.py b/test/integration/test_kubernetes_runner.py index d1b90b87cff..245271fe7a2 100644 --- a/test/integration/test_kubernetes_runner.py +++ b/test/integration/test_kubernetes_runner.py @@ -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