@@ -868,11 +868,11 @@ impl PyType {
868868 } ) ?;
869869 }
870870
871- if let Some ( initter ) = typ. get_super_attr ( identifier ! ( vm, __init_subclass__) ) {
872- let initter = vm
873- . call_get_descriptor_specific ( initter . clone ( ) , None , Some ( typ. clone ( ) . into ( ) ) )
874- . unwrap_or ( Ok ( initter ) ) ?;
875- vm. invoke ( & initter , kwargs) ?;
871+ if let Some ( init_subclass ) = typ. get_super_attr ( identifier ! ( vm, __init_subclass__) ) {
872+ let init_subclass = vm
873+ . call_get_descriptor_specific ( init_subclass . clone ( ) , None , Some ( typ. clone ( ) . into ( ) ) )
874+ . unwrap_or ( Ok ( init_subclass ) ) ?;
875+ vm. invoke ( & init_subclass , kwargs) ?;
876876 } ;
877877
878878 Ok ( typ. into ( ) )
@@ -1156,14 +1156,14 @@ fn take_next_base(bases: &mut [Vec<PyTypeRef>]) -> Option<PyTypeRef> {
11561156}
11571157
11581158fn linearise_mro ( mut bases : Vec < Vec < PyTypeRef > > ) -> Result < Vec < PyTypeRef > , String > {
1159- vm_trace ! ( "Linearising MRO: {:?}" , bases) ;
1159+ vm_trace ! ( "Linearise MRO: {:?}" , bases) ;
11601160 // Python requires that the class direct bases are kept in the same order.
11611161 // This is called local precedence ordering.
11621162 // This means we must verify that for classes A(), B(A) we must reject C(A, B) even though this
11631163 // algorithm will allow the mro ordering of [C, B, A, object].
11641164 // To verify this, we make sure non of the direct bases are in the mro of bases after them.
11651165 for ( i, base_mro) in bases. iter ( ) . enumerate ( ) {
1166- let base = & base_mro[ 0 ] ; // Mros cannot be empty.
1166+ let base = & base_mro[ 0 ] ; // MROs cannot be empty.
11671167 for later_mro in & bases[ i + 1 ..] {
11681168 // We start at index 1 to skip direct bases.
11691169 // This will not catch duplicate bases, but such a thing is already tested for.
0 commit comments