Fixed to return the mro function

Fixed to return the mro function
to include its own class

Fixes #1490
This commit is contained in:
HyeockJinKim
2019-10-09 01:06:44 +09:00
parent 26073152cd
commit 75eff109ba

View File

@@ -220,8 +220,9 @@ impl PyClassRef {
}
fn type_mro(cls: PyClassRef, vm: &VirtualMachine) -> PyObjectRef {
vm.ctx
.new_list(cls.mro.iter().map(|x| x.clone().into_object()).collect())
let mut mro = vec![cls.clone().into_object()];
mro.extend(cls.mro.iter().map(|x| x.clone().into_object()));
vm.ctx.new_list(mro)
}
/*