(obj: &PyObjectRef, vm: &VirtualMachine)
| 106 | } |
| 107 | |
| 108 | pub(crate) fn warn_if_bool_fd(obj: &PyObjectRef, vm: &VirtualMachine) -> PyResult<()> { |
| 109 | use crate::class::StaticType; |
| 110 | if obj |
| 111 | .class() |
| 112 | .is(crate::builtins::bool_::PyBool::static_type()) |
| 113 | { |
| 114 | crate::stdlib::_warnings::warn( |
| 115 | vm.ctx.exceptions.runtime_warning, |
| 116 | "bool is used as a file descriptor".to_owned(), |
| 117 | 1, |
| 118 | vm, |
| 119 | )?; |
| 120 | } |
| 121 | Ok(()) |
| 122 | } |
| 123 | |
| 124 | impl TryFromObject for crt_fd::Owned { |
| 125 | fn try_from_object(vm: &VirtualMachine, obj: PyObjectRef) -> PyResult<Self> { |
no test coverage detected