Don't let Interpreter::run silently ignore result value

This commit is contained in:
Jeong YunWon authored and Jeong, YunWon committed 2024-08-07 07:06:15 +09:00
1 parent 6092c07eb5
commit 08e7ec948b
1 file changed
+2 -2
+2 -2
View File
@@ -97,9 +97,9 @@ impl Interpreter {
///
/// See [`finalize`] for the finalization steps.
/// See also [`enter`] for pure function call to obtain Python exception.
pub fn run<F, R>(self, f: F) -> u8
pub fn run<F>(self, f: F) -> u8
where
F: FnOnce(&VirtualMachine) -> PyResult<R>,
F: FnOnce(&VirtualMachine) -> PyResult<()>,
{
let res = self.enter(|vm| f(vm));
self.finalize(res.err())