Run [`Interpreter::enter`] and call [`VirtualMachine::expect_pyresult`] for the result. This function is useful when you want to expect a result from the function, but also print useful panic information when exception raised. See also [`Interpreter::enter`] and [`VirtualMachine::expect_pyresult`] for more information.
(&self, f: F, msg: &str)
| 365 | /// |
| 366 | /// See also [`Interpreter::enter`] and [`VirtualMachine::expect_pyresult`] for more information. |
| 367 | pub fn enter_and_expect<F, R>(&self, f: F, msg: &str) -> R |
| 368 | where |
| 369 | F: FnOnce(&VirtualMachine) -> PyResult<R>, |
| 370 | { |
| 371 | self.enter(|vm| { |
| 372 | let result = f(vm); |
| 373 | vm.expect_pyresult(result, msg) |
| 374 | }) |
| 375 | } |
| 376 | |
| 377 | /// Run a function with the main virtual machine and return exit code. |
| 378 | /// |
nothing calls this directly
no test coverage detected