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 50d1fd1 commit 0920200Copy full SHA for 0920200
bigcodebench/eval/utils.py
@@ -228,8 +228,11 @@ def safe_exec(*args, **kwargs):
228
# Wait for a short time to see if the process terminates
229
for _ in range(10): # Wait up to 1 second
230
time.sleep(0.1)
231
- if os.waitpid(pid, os.WNOHANG) != (0, 0):
232
- break
+ try:
+ # Check if the process has terminated
233
+ os.kill(pid, 0)
234
+ except ProcessLookupError:
235
+ break # Process has terminated
236
else:
237
# If the process didn't terminate, try SIGKILL
238
os.kill(pid, signal.SIGKILL)
0 commit comments