MCPcopy Index your code
hub / github.com/RustPython/RustPython / print_stack

Method print_stack

crates/stdlib/src/_asyncio.rs:1633–1647  ·  view source on GitHub ↗
(
            zelf: PyRef<Self>,
            args: PrintStackArgs,
            vm: &VirtualMachine,
        )

Source from the content-addressed store, hash-verified

1631
1632 #[pymethod]
1633 fn print_stack(
1634 zelf: PyRef<Self>,
1635 args: PrintStackArgs,
1636 vm: &VirtualMachine,
1637 ) -> PyResult<()> {
1638 let limit = args.limit.flatten().unwrap_or_else(|| vm.ctx.none());
1639 let file = args.file.flatten().unwrap_or_else(|| vm.ctx.none());
1640 // vm.import returns the top-level module, get base_tasks submodule
1641 let asyncio = vm.import("asyncio.base_tasks", 0)?;
1642 let base_tasks = asyncio.get_attr(vm.ctx.intern_str("base_tasks"), vm)?;
1643 let print_stack_func =
1644 base_tasks.get_attr(vm.ctx.intern_str("_task_print_stack"), vm)?;
1645 print_stack_func.call((zelf, limit, file), vm)?;
1646 Ok(())
1647 }
1648
1649 #[pymethod]
1650 fn _make_cancelled_error(&self, vm: &VirtualMachine) -> PyBaseExceptionRef {

Callers

nothing calls this directly

Calls 6

noneMethod · 0.80
intern_strMethod · 0.80
flattenMethod · 0.45
importMethod · 0.45
get_attrMethod · 0.45
callMethod · 0.45

Tested by

no test coverage detected