(
zelf: &PyRef<Self>,
loop_: Option<PyObjectRef>,
vm: &VirtualMachine,
)
| 185 | } |
| 186 | |
| 187 | fn py_init( |
| 188 | zelf: &PyRef<Self>, |
| 189 | loop_: Option<PyObjectRef>, |
| 190 | vm: &VirtualMachine, |
| 191 | ) -> PyResult<()> { |
| 192 | // Get the event loop |
| 193 | let loop_obj = match loop_ { |
| 194 | Some(l) if !vm.is_none(&l) => l, |
| 195 | _ => get_event_loop(vm)?, |
| 196 | }; |
| 197 | *zelf.fut_loop.write() = Some(loop_obj.clone()); |
| 198 | |
| 199 | // Check if loop has get_debug method and call it |
| 200 | if let Ok(Some(get_debug)) = |
| 201 | vm.get_attribute_opt(loop_obj.clone(), vm.ctx.intern_str("get_debug")) |
| 202 | && let Ok(debug) = get_debug.call((), vm) |
| 203 | && debug.try_to_bool(vm).unwrap_or(false) |
| 204 | { |
| 205 | // Get source traceback |
| 206 | if let Ok(tb_module) = vm.import("traceback", 0) |
| 207 | && let Ok(Some(extract_stack)) = |
| 208 | vm.get_attribute_opt(tb_module, vm.ctx.intern_str("extract_stack")) |
| 209 | && let Ok(tb) = extract_stack.call((), vm) |
| 210 | { |
| 211 | *zelf.fut_source_tb.write() = Some(tb); |
| 212 | } |
| 213 | } |
| 214 | |
| 215 | Ok(()) |
| 216 | } |
| 217 | |
| 218 | #[pymethod] |
| 219 | fn result(&self, vm: &VirtualMachine) -> PyResult { |
nothing calls this directly
no test coverage detected