Skip to content

Commit 030af4e

Browse files
formatting
Created using spr 1.3.6
1 parent c18fdac commit 030af4e

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

llvm/utils/lit/lit/TestRunner.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,7 @@ def executeBuiltinUmask(cmd, shenv):
601601
raise InternalShellError(cmd, "Error: 'umask': %s" % str(err))
602602
return ShellCommandResult(cmd, "", "", 0, False)
603603

604+
604605
def executeBuiltinUlimit(cmd, shenv):
605606
"""executeBuiltinUlimit - Change the current limits."""
606607
if os.name != "posix":
@@ -616,7 +617,9 @@ def executeBuiltinUlimit(cmd, shenv):
616617
elif cmd.args[1] == "-n":
617618
shenv.ulimit["RLIMIT_NOFILE"] = new_limit
618619
else:
619-
raise InternalShellError(cmd, "'ulimit' does not support option: %s" % cmd.args[1])
620+
raise InternalShellError(
621+
cmd, "'ulimit' does not support option: %s" % cmd.args[1]
622+
)
620623
return ShellCommandResult(cmd, "", "", 0, False)
621624

622625

@@ -945,7 +948,7 @@ def _executeShCmd(cmd, shenv, results, timeoutHelper):
945948
# with some core utility distributions.
946949
if kIsWindows:
947950
args = quote_windows_command(args)
948-
951+
949952
# Handle any resource limits. We do this by launching the command with
950953
# a wrapper that sets the necessary limits. We use a wrapper rather than
951954
# setting the limits in process as we cannot reraise the limits back to
@@ -954,7 +957,9 @@ def _executeShCmd(cmd, shenv, results, timeoutHelper):
954957
args.insert(0, sys.executable)
955958
args.insert(1, os.path.join(builtin_commands_dir, "_launch_with_limit.py"))
956959
for limit in cmd_shenv.ulimit:
957-
cmd_shenv.env["LIT_INTERNAL_ULIMIT_" + limit] = str(cmd_shenv.ulimit[limit])
960+
cmd_shenv.env["LIT_INTERNAL_ULIMIT_" + limit] = str(
961+
cmd_shenv.ulimit[limit]
962+
)
958963

959964
try:
960965
# TODO(boomanaiden154): We currently wrap the subprocess.Popen with

llvm/utils/lit/lit/builtin_commands/_launch_with_limit.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55

66
ULIMIT_ENV_VAR_PREFIX = "LIT_INTERNAL_ULIMIT_"
77

8+
89
def main(argv):
910
command_args = argv[1:]
1011
for env_var in os.environ:
1112
if env_var.startswith(ULIMIT_ENV_VAR_PREFIX):
12-
limit_str = env_var[len(ULIMIT_ENV_VAR_PREFIX):]
13+
limit_str = env_var[len(ULIMIT_ENV_VAR_PREFIX) :]
1314
limit_value = int(os.environ[env_var])
1415
limit = (limit_value, limit_value)
1516
if limit_str == "RLIMIT_AS":
@@ -18,7 +19,7 @@ def main(argv):
1819
resource.setrlimit(resource.RLIMIT_NOFILE, limit)
1920
process_output = subprocess.run(command_args)
2021
sys.exit(process_output.returncode)
21-
22+
2223

2324
if __name__ == "__main__":
2425
main(sys.argv)

0 commit comments

Comments
 (0)