(vm: &VirtualMachine)
| 1036 | #[cfg(feature = "threading")] |
| 1037 | #[pyfunction] |
| 1038 | fn _current_frames(vm: &VirtualMachine) -> PyResult<PyDictRef> { |
| 1039 | use crate::AsObject; |
| 1040 | use crate::stdlib::_thread::get_all_current_frames; |
| 1041 | |
| 1042 | let frames = get_all_current_frames(vm); |
| 1043 | let dict = vm.ctx.new_dict(); |
| 1044 | |
| 1045 | for (thread_id, frame) in frames { |
| 1046 | let key = vm.ctx.new_int(thread_id); |
| 1047 | dict.set_item(key.as_object(), frame.into(), vm)?; |
| 1048 | } |
| 1049 | |
| 1050 | Ok(dict) |
| 1051 | } |
| 1052 | |
| 1053 | /// Return a dictionary mapping each thread's identifier to its currently |
| 1054 | /// active exception, or None if no exception is active. |
nothing calls this directly
no test coverage detected