Skip to content

Commit bd4f897

Browse files
committed
[llvm-lit]
When executing not --crash env without any arguments, it fails with exit code 127 because env reuires a subcommand. This path addresses the issue by encoding the command to properly return environment variables even when no arguments are provided.
1 parent 83251a2 commit bd4f897

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/utils/lit/lit/TestRunner.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,8 @@ def _executeShCmd(cmd, shenv, results, timeoutHelper):
743743
cmd_shenv = ShellEnvironment(shenv.cwd, shenv.env)
744744
args = updateEnv(cmd_shenv, args)
745745
if not args:
746-
raise InternalShellError(j, "Error: 'env' requires a" " subcommand")
746+
# Return the environment variables if no argument is provided
747+
return {key: value for key, value in cmd_shenv.env.items()}
747748
elif args[0] == "not":
748749
not_args.append(args.pop(0))
749750
not_count += 1

0 commit comments

Comments
 (0)