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

Commit 9d4fda5

Browse files
committed
Fix blank iofilename
1 parent bc17891 commit 9d4fda5

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

dockerjudge/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from . import test_case
1212
from .thread import Thread
1313

14-
__version__ = '1.2.4'
14+
__version__ = '1.2.5'
1515

1616

1717
def judge(processor, source, tests, config=None,
@@ -141,6 +141,7 @@ def run(container, processor, source, tests, config=None):
141141
'Compile and judge'
142142
config.setdefault('callback', {})
143143
config.setdefault('demux', {})
144+
config.setdefault('iofilename', {})
144145
exec_result = compile_source_code(container, processor, source, config)
145146
if exec_result.exit_code:
146147
return [[(Status.CE, (None, None), .0)] * len(tests),

dockerjudge/test_case.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def _get_io_file_path(ioro, processor, i, config):
2323
'Get the absolute path of input or output file'
2424
return PurePosixPath(
2525
f"{processor.workdir}/{i}/{config['iofilename'][ioro]}"
26-
if ioro in config.get('iofilename', {})
26+
if config['iofilename'].get(ioro)
2727
else f'{processor.workdir}/{i}.{ioro}'
2828
)
2929

@@ -38,7 +38,7 @@ def judge(container, processor, i, ioput, config):
3838
+ ' sh -c ' + shlex.quote(processor.judge)
3939
+ ' > ' + f'{processor.workdir}/{i}.out'
4040
+ (' < ' + f'{processor.workdir}/{i}.in'
41-
if 'in' not in config.get('iofilename', {}) else '')
41+
if not config['iofilename'].get('in') else '')
4242
),
4343
workdir=f'{processor.workdir}/{i}', demux=True
4444
)

0 commit comments

Comments
 (0)