Improve rest of attribute protocol interface.

This commit is contained in:
Adam Kelly
2018-08-21 20:03:46 +01:00
parent 4278a1ecc8
commit 4b322fe5aa
5 changed files with 41 additions and 43 deletions

View File

@@ -66,6 +66,8 @@ pub fn create_member_descriptor_type(type_type: PyObjectRef, object: PyObjectRef
}
fn member_get(vm: &mut VirtualMachine, mut args: PyFuncArgs) -> PyResult {
let function = args.shift().get_attr(&String::from("function"));
vm.invoke(function, args)
match args.shift().get_attr("function") {
Some(function) => vm.invoke(function, args),
None => Err(vm.new_exception(String::from("Attribute Error"))),
}
}