Spaces:
Runtime error
Runtime error
Update execute.py
Browse files- execute.py +6 -1
execute.py
CHANGED
@@ -38,7 +38,12 @@ def check_correctness(check_program, output, timeout, task_id, completion_id):
|
|
38 |
"""
|
39 |
manager = multiprocessing.Manager()
|
40 |
result = manager.list()
|
41 |
-
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
if not result:
|
44 |
result.append("timed out")
|
|
|
38 |
"""
|
39 |
manager = multiprocessing.Manager()
|
40 |
result = manager.list()
|
41 |
+
|
42 |
+
p = multiprocessing.Process(target=unsafe_execute, args=(check_program, output, result, timeout))
|
43 |
+
p.start()
|
44 |
+
p.join(timeout=timeout + 1)
|
45 |
+
if p.is_alive():
|
46 |
+
p.kill()
|
47 |
|
48 |
if not result:
|
49 |
result.append("timed out")
|