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