TimeOutError exception handling

This commit is contained in:
Francesco Bertolotti 2025-05-28 10:42:32 +02:00
parent 5fb578aa00
commit 2fc30a92ec

View File

@ -330,7 +330,11 @@ class MBPPEvaluator(BaseEvaluator):
r"'(.*)'\s*\[DONE\]",
]
for p in patterns:
match = re.search(p, text, re.DOTALL, timeout=10.0)
try:
match = re.search(p, text, re.DOTALL, timeout=10.0)
except TimeoutError:
match = None
if match:
text = match.group(1)
break