We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0920200 commit f771678Copy full SHA for f771678
bigcodebench/eval/utils.py
@@ -225,19 +225,16 @@ def safe_exec(*args, **kwargs):
225
for pid in child_pids:
226
try:
227
os.kill(pid, signal.SIGTERM)
228
- # Wait for a short time to see if the process terminates
229
- for _ in range(10): # Wait up to 1 second
+ for _ in range(10):
230
time.sleep(0.1)
231
232
- # Check if the process has terminated
233
os.kill(pid, 0)
234
except ProcessLookupError:
235
- break # Process has terminated
+ break
236
else:
237
- # If the process didn't terminate, try SIGKILL
238
os.kill(pid, signal.SIGKILL)
239
240
- pass # Process already terminated
+ pass
241
except Exception as e:
242
print(f"Error handling process {pid}: {e}")
243
0 commit comments