Merge Windows socket I/O repair into compiler prerequisites

Combine exact #8951 mapping head c78d811f and #9093 socket I/O head a26d1611 on main e09846b4.

Assisted-by: OpenAI Codex: model identifier unavailable
This commit is contained in:
dot committed 2026-10-13 18:47:40 +09:00
commit 9fbfa591b8
1 file changed
+9 -6
+9 -6
View File
@@ -408,19 +408,22 @@ mod _multiprocessing {
#[pyfunction]
fn recv(socket: usize, size: usize, vm: &VirtualMachine) -> PyResult<Vec<u8>> {
let mut buf =
host_multiprocessing::recv_socket(socket as host_multiprocessing::RawSocket, size)
.map_err(|_| vm.new_last_os_error())?;
let mut buf = vm
.allow_threads(|| {
host_multiprocessing::recv_socket(socket as host_multiprocessing::RawSocket, size)
})
.map_err(|error| error.to_pyexception(vm))?;
buf.shrink_to_fit();
Ok(buf)
}
#[pyfunction]
fn send(socket: usize, buf: ArgBytesLike, vm: &VirtualMachine) -> PyResult<core::ffi::c_int> {
buf.with_ref(|b| {
host_multiprocessing::send_socket(socket as host_multiprocessing::RawSocket, b)
let buf = buf.borrow_buf_unlocked(vm)?;
vm.allow_threads(|| {
host_multiprocessing::send_socket(socket as host_multiprocessing::RawSocket, &buf)
})
.map_err(|_| vm.new_last_os_error())
.map_err(|error| error.to_pyexception(vm))
}
}