(x: PyObjectRef, vm: &VirtualMachine)
| 3420 | |
| 3421 | #[pyfunction] |
| 3422 | fn dup(x: PyObjectRef, vm: &VirtualMachine) -> Result<RawSocket, IoOrPyException> { |
| 3423 | let sock = get_raw_sock(x, vm)?; |
| 3424 | let sock = core::mem::ManuallyDrop::new(sock_from_raw(sock, vm)?); |
| 3425 | let newsock = sock.try_clone()?; |
| 3426 | let fd = into_sock_fileno(newsock); |
| 3427 | #[cfg(windows)] |
| 3428 | crate::vm::stdlib::nt::raw_set_handle_inheritable(fd as _, false)?; |
| 3429 | Ok(fd) |
| 3430 | } |
| 3431 | |
| 3432 | #[pyfunction] |
| 3433 | fn close(x: PyObjectRef, vm: &VirtualMachine) -> Result<(), IoOrPyException> { |
no test coverage detected