(timeout: Option<ArgIntoFloat>, vm: &VirtualMachine)
| 3401 | |
| 3402 | #[pyfunction] |
| 3403 | fn setdefaulttimeout(timeout: Option<ArgIntoFloat>, vm: &VirtualMachine) -> PyResult<()> { |
| 3404 | let val = match timeout { |
| 3405 | Some(t) => { |
| 3406 | let f = t.into_float(); |
| 3407 | if f.is_nan() { |
| 3408 | return Err(vm.new_value_error("Invalid value NaN (not a number)")); |
| 3409 | } |
| 3410 | if f < 0.0 || !f.is_finite() { |
| 3411 | return Err(vm.new_value_error("Timeout value out of range")); |
| 3412 | } |
| 3413 | f |
| 3414 | } |
| 3415 | None => -1.0, |
| 3416 | }; |
| 3417 | DEFAULT_TIMEOUT.store(val); |
| 3418 | Ok(()) |
| 3419 | } |
| 3420 | |
| 3421 | #[pyfunction] |
| 3422 | fn dup(x: PyObjectRef, vm: &VirtualMachine) -> Result<RawSocket, IoOrPyException> { |
nothing calls this directly
no test coverage detected