From 08e7ec948b4c515c55e5bb93a35dbaca3290c9b2 Mon Sep 17 00:00:00 2001 From: Jeong YunWon Date: Wed, 7 Aug 2024 05:12:50 +0900 Subject: [PATCH] Don't let Interpreter::run silently ignore result value --- vm/src/vm/interpreter.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vm/src/vm/interpreter.rs b/vm/src/vm/interpreter.rs index 515a93bfb..af28ad87a 100644 --- a/vm/src/vm/interpreter.rs +++ b/vm/src/vm/interpreter.rs @@ -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(self, f: F) -> u8 + pub fn run(self, f: F) -> u8 where - F: FnOnce(&VirtualMachine) -> PyResult, + F: FnOnce(&VirtualMachine) -> PyResult<()>, { let res = self.enter(|vm| f(vm)); self.finalize(res.err())