fix formatting

This commit is contained in:
Chris Moradi
2021-11-13 17:35:28 -08:00
parent ab58885734
commit 0500aa1e59

View File

@@ -37,12 +37,14 @@ impl PyBaseObject {
};
// Ensure that all abstract methods are implemented before instantiating instance.
if let Some(abs_methods) = cls.get_attr("__abstractmethods__"){
if let Some(abs_methods) = cls.get_attr("__abstractmethods__") {
if let Some(iter) = vm.get_method(abs_methods, "__len__") {
let values = vm.invoke(&iter?, ())?;
let unimplemented_abstract_method_count = super::int::get_value(&values);
if unimplemented_abstract_method_count > &BigInt::from(0) {
return Err(vm.new_type_error("You must implement the abstract methods".to_owned()));
return Err(
vm.new_type_error("You must implement the abstract methods".to_owned())
);
}
}
}