(vm: &VirtualMachine, obj: PyObjectRef)
| 127 | |
| 128 | impl TryFromObject for Selectable { |
| 129 | fn try_from_object(vm: &VirtualMachine, obj: PyObjectRef) -> PyResult<Self> { |
| 130 | let fno = obj.try_to_value(vm).or_else(|_| { |
| 131 | let meth = vm.get_method_or_type_error( |
| 132 | obj.clone(), |
| 133 | vm.ctx.interned_str("fileno").unwrap(), |
| 134 | || "select arg must be an int or object with a fileno() method".to_owned(), |
| 135 | )?; |
| 136 | meth.call((), vm)?.try_into_value(vm) |
| 137 | })?; |
| 138 | Ok(Self { obj, fno }) |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | // Keep it in a MaybeUninit, since on windows FD_ZERO doesn't actually zero the whole thing |
nothing calls this directly
no test coverage detected