diff --git a/vm/src/obj/objproperty.rs b/vm/src/obj/objproperty.rs index 776f06af9..2e105bd50 100644 --- a/vm/src/obj/objproperty.rs +++ b/vm/src/obj/objproperty.rs @@ -28,13 +28,10 @@ pub type PyReadOnlyPropertyRef = PyRef; #[pyimpl] impl PyReadOnlyProperty { #[pymethod(name = "__get__")] - fn get( - zelf: PyRef, - obj: PyObjectRef, - _owner: OptionalArg, - vm: &VirtualMachine, - ) -> PyResult { - if obj.is(vm.ctx.none.as_object()) { + fn get(zelf: PyRef, obj: PyObjectRef, cls: PyClassRef, vm: &VirtualMachine) -> PyResult { + if cls.is(&vm.ctx.types.type_type) { + vm.invoke(&zelf.getter, cls.into_object()) + } else if vm.is_none(&obj) { Ok(zelf.into_object()) } else { vm.invoke(&zelf.getter, obj)