(future: &PyObject, vm: &VirtualMachine)
| 895 | } |
| 896 | |
| 897 | fn get_future_repr_info_fallback(future: &PyObject, vm: &VirtualMachine) -> PyResult<Wtf8Buf> { |
| 898 | // Fallback: build repr from properties directly |
| 899 | if let Ok(Some(state)) = |
| 900 | vm.get_attribute_opt(future.to_owned(), vm.ctx.intern_str("_state")) |
| 901 | { |
| 902 | let s = state |
| 903 | .str(vm) |
| 904 | .map(|s| s.as_wtf8().to_lowercase()) |
| 905 | .unwrap_or_else(|_| Wtf8Buf::from("unknown")); |
| 906 | return Ok(s); |
| 907 | } |
| 908 | Ok(Wtf8Buf::from("state=unknown")) |
| 909 | } |
| 910 | |
| 911 | fn get_task_repr_info(task: &PyObject, vm: &VirtualMachine) -> PyResult<Wtf8Buf> { |
| 912 | // vm.import returns the top-level module, get base_tasks submodule |
no test coverage detected