Fix compile error when using ``vm-tracing-logging``

This commit is contained in:
Buciu Theodor Marian
2024-11-10 16:23:44 +02:00
committed by Jeong, YunWon
parent 98d09e7816
commit 4910b308ee
2 changed files with 3 additions and 2 deletions

View File

@@ -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);

View File

@@ -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,