mirror of
https://github.com/openai/codex.git
synced 2026-04-24 22:54:54 +00:00
Fix sandbox multiprocessing test on Python 3.14
This commit is contained in:
committed by
Matthew Zeng
parent
e893e83eb9
commit
6084fcf0f3
@@ -77,8 +77,17 @@ async fn python_multiprocessing_lock_works_under_sandbox() {
|
||||
};
|
||||
|
||||
let python_code = r#"import multiprocessing
|
||||
import sys
|
||||
from multiprocessing import Lock, Process
|
||||
|
||||
# Python 3.14 defaults to forkserver on some Linux distros, which can
|
||||
# be blocked by the sandbox. Force fork to keep the test stable.
|
||||
if sys.platform.startswith("linux"):
|
||||
try:
|
||||
multiprocessing.set_start_method("fork")
|
||||
except RuntimeError:
|
||||
pass
|
||||
|
||||
def f(lock):
|
||||
with lock:
|
||||
print("Lock acquired in child process")
|
||||
|
||||
Reference in New Issue
Block a user