diff --git a/vm/src/exceptions.rs b/vm/src/exceptions.rs index 89ad82972..7d43f7e27 100644 --- a/vm/src/exceptions.rs +++ b/vm/src/exceptions.rs @@ -84,9 +84,8 @@ impl PyBaseException { } #[pyproperty(name = "__traceback__", setter)] - fn set_traceback(&self, traceback: Option, vm: &VirtualMachine) -> PyResult { + fn set_traceback(&self, traceback: Option, _vm: &VirtualMachine) { self.traceback.replace(traceback); - Ok(vm.get_none()) } #[pyproperty(name = "__cause__")] diff --git a/vm/src/obj/objproperty.rs b/vm/src/obj/objproperty.rs index f911801a6..558b2196e 100644 --- a/vm/src/obj/objproperty.rs +++ b/vm/src/obj/objproperty.rs @@ -252,6 +252,11 @@ pub struct PropertyBuilder<'a> { setter: Option, } +pub trait PropertySetterResult {} + +impl PropertySetterResult for PyResult {} +impl PropertySetterResult for () {} + impl<'a> PropertyBuilder<'a> { pub fn new(ctx: &'a PyContext) -> Self { Self { @@ -270,7 +275,10 @@ impl<'a> PropertyBuilder<'a> { } } - pub fn add_setter>(self, func: F) -> Self { + pub fn add_setter>( + self, + func: F, + ) -> Self { let func = self.ctx.new_rustfunc(func); Self { ctx: self.ctx,