Spaces:
Sleeping
Sleeping
Commit
·
68991e6
1
Parent(s):
0e7922f
Fix scope
Browse files- execute.py +5 -5
execute.py
CHANGED
|
@@ -24,10 +24,7 @@ import platform
|
|
| 24 |
import signal
|
| 25 |
import tempfile
|
| 26 |
|
| 27 |
-
|
| 28 |
-
"python": unsafe_execute,
|
| 29 |
-
"javascript": unsafe_execute_js,
|
| 30 |
-
}
|
| 31 |
|
| 32 |
def check_correctness(check_program, timeout, task_id, completion_id, language):
|
| 33 |
"""
|
|
@@ -40,7 +37,10 @@ def check_correctness(check_program, timeout, task_id, completion_id, language):
|
|
| 40 |
manager = multiprocessing.Manager()
|
| 41 |
result = manager.list()
|
| 42 |
|
| 43 |
-
|
|
|
|
|
|
|
|
|
|
| 44 |
|
| 45 |
p.start()
|
| 46 |
p.join(timeout=timeout + 1)
|
|
|
|
| 24 |
import signal
|
| 25 |
import tempfile
|
| 26 |
|
| 27 |
+
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
def check_correctness(check_program, timeout, task_id, completion_id, language):
|
| 30 |
"""
|
|
|
|
| 37 |
manager = multiprocessing.Manager()
|
| 38 |
result = manager.list()
|
| 39 |
|
| 40 |
+
if language == "python":
|
| 41 |
+
p = multiprocessing.Process(target=unsafe_execute, args=(check_program, result, timeout))
|
| 42 |
+
elif language == "javascript":
|
| 43 |
+
p = multiprocessing.Process(target=unsafe_execute_js, args=(check_program, result, timeout))
|
| 44 |
|
| 45 |
p.start()
|
| 46 |
p.join(timeout=timeout + 1)
|