Function
ensure_unclosed
(file: &PyObject, msg: &str, vm: &VirtualMachine)
Source from the content-addressed store, hash-verified
| 162 | } |
| 163 | |
| 164 | fn ensure_unclosed(file: &PyObject, msg: &str, vm: &VirtualMachine) -> PyResult<()> { |
| 165 | if file.get_attr("closed", vm)?.try_to_bool(vm)? { |
| 166 | Err(vm.new_value_error(msg)) |
| 167 | } else { |
| 168 | Ok(()) |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | /// Check if an error is an OSError with errno == EINTR. |
| 173 | /// If so, call check_signals() and return Ok(None) to indicate retry. |
Tested by
no test coverage detected