[Evaluation] Fix KeyError when the instance failed prematurely (#7864)

This commit is contained in:
Engel Nyst 2025-04-15 17:19:31 +02:00 committed by GitHub
parent e0fcd7a61e
commit 5e5bf23f9c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -864,7 +864,7 @@ if __name__ == '__main__':
# Also make sure git_patch is not empty - otherwise we fall back to previous attempt (empty patch is worse than anything else)
if (
instance['instance_id'] not in added_instance_ids
and instance['test_result']['git_patch'].strip()
and instance['test_result'].get('git_patch', '').strip()
):
fout.write(line)
added_instance_ids.add(instance['instance_id'])