Skip to content
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.

Commit

Permalink
Fix multiple commands in judging
Browse files Browse the repository at this point in the history
  • Loading branch information
wxh06 committed Jun 10, 2020
1 parent d0fe740 commit 3dc2539
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions dockerjudge/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,13 @@ def _judge(dir, container, commands, ioput, timeout, iofile) -> (str, float):
'{}/{}'.format(shlex.quote(ioput[0]),
dir, iofile[0])])
result = container.exec_run(['bash', '-c', 'cd {}&&time timeout -s '
'KILL {} {}<{}'.format(dir, timeout,
commands[1] % '..',
iofile[0])],
'KILL {} sh -c {}<{}'.format(dir, timeout,
shlex.quote(
commands
[1]
% '..'
),
iofile[0])],
demux=True)
else:
result = container.exec_run(['bash', '-c', 'cd {}&&time echo {}|'
Expand Down

0 comments on commit 3dc2539

Please sign in to comment.