We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 229bd32 commit aa31b60Copy full SHA for aa31b60
1 file changed
bigcodebench/eval/utils.py
@@ -221,7 +221,19 @@ def safe_exec(*args, **kwargs):
221
try:
222
yield
223
finally:
224
- # Restore original functions after the block
+ for pid in child_pids:
225
+ try:
226
+ os.kill(pid, signal.SIGTERM)
227
+ os.waitpid(pid, 0)
228
+ except ProcessLookupError:
229
+ pass # Process already terminated
230
+ except Exception as e:
231
+ print(f"Error terminating process {pid}: {e}")
232
233
+ os.kill(pid, signal.SIGKILL)
234
+ except Exception:
235
+ pass
236
+
237
os.kill = original_kill
238
os.killpg = original_killpg
239
os.system = original_system
0 commit comments