mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-29 03:04:38 +08:00
Don't let Interpreter::run silently ignore result value
This commit is contained in:
1 parent
6092c07eb5
commit
08e7ec948b
1 file changed
+2
-2
@@ -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())
|
||||
|
||||
Reference in new issue
Block a user