From f3f572d8d79b55c39f6b552ba2b3ee73f2502575 Mon Sep 17 00:00:00 2001 From: Buciu Theodor Marian Date: Sun, 10 Nov 2024 16:23:44 +0200 Subject: [PATCH] Fix compile error when using ```vm-tracing-logging``` --- vm/src/frame.rs | 2 +- vm/src/protocol/callable.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/vm/src/frame.rs b/vm/src/frame.rs index 5a42a1f88a..879ecdafc2 100644 --- a/vm/src/frame.rs +++ b/vm/src/frame.rs @@ -382,7 +382,7 @@ impl ExecutingFrame<'_> { let next = exception.traceback(); let new_traceback = PyTraceback::new(next, frame.object.to_owned(), frame.lasti(), loc.row); - vm_trace!("Adding to traceback: {:?} {:?}", new_traceback, loc.row()); + vm_trace!("Adding to traceback: {:?} {:?}", new_traceback, loc.row); exception.set_traceback(Some(new_traceback.into_ref(&vm.ctx))); vm.contextualize_exception(&exception); diff --git a/vm/src/protocol/callable.rs b/vm/src/protocol/callable.rs index 8a04e2021e..ca10555720 100644 --- a/vm/src/protocol/callable.rs +++ b/vm/src/protocol/callable.rs @@ -24,16 +24,17 @@ impl PyObject { /// PyObject_Call pub fn call_with_args(&self, args: FuncArgs, vm: &VirtualMachine) -> PyResult { - vm_trace!("Invoke: {:?} {:?}", callable, args); let Some(callable) = self.to_callable() else { return Err( vm.new_type_error(format!("'{}' object is not callable", self.class().name())) ); }; + vm_trace!("Invoke: {:?} {:?}", callable, args); callable.invoke(args, vm) } } +#[derive(Debug)] pub struct PyCallable<'a> { pub obj: &'a PyObject, pub call: GenericMethod,