Handle empty case data
This commit is contained in:
parent
2828007a51
commit
e8ef46ffcf
1 changed files with 5 additions and 3 deletions
|
@ -149,8 +149,10 @@ def get_visible_content(data):
|
||||||
|
|
||||||
|
|
||||||
def get_input_answer(case, archive):
|
def get_input_answer(case, archive):
|
||||||
result = {}
|
result = {'input': '', 'answer': ''}
|
||||||
|
if (len(case.input_file)):
|
||||||
result['input'] = get_visible_content(archive.read(case.input_file))
|
result['input'] = get_visible_content(archive.read(case.input_file))
|
||||||
|
if (len(case.output_file)):
|
||||||
result['answer'] = get_visible_content(archive.read(case.output_file))
|
result['answer'] = get_visible_content(archive.read(case.output_file))
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue