File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -101,22 +101,21 @@ impl C3Mro<'_> {
101101 }
102102}
103103
104- fn c3_boundary ( py : Python , bases : & [ PyTypeReference ] ) -> usize {
104+ fn c3_boundary ( py : Python , bases : & [ PyTypeReference ] ) -> PyResult < usize > {
105105 let mut boundary = 0 ;
106106
107107 for ( i, base) in bases. iter ( ) . rev ( ) . enumerate ( ) {
108108 if base
109109 . wrapped ( )
110110 . bind ( py)
111- . hasattr ( intern ! ( py, "__abstractmethods__" ) )
112- . unwrap ( )
111+ . hasattr ( intern ! ( py, "__abstractmethods__" ) ) ?
113112 {
114113 boundary = bases. len ( ) - i;
115114 break ;
116115 }
117116 }
118117
119- boundary
118+ Ok ( boundary)
120119}
121120
122121fn c3_mro (
@@ -134,7 +133,7 @@ fn c3_mro(
134133 }
135134 Err ( e) => return Err ( e) ,
136135 } ;
137- let boundary = c3_boundary ( py, & bases) ;
136+ let boundary = c3_boundary ( py, & bases) ? ;
138137 eprintln ! ( "boundary = {boundary}" ) ;
139138 let base = & bases[ boundary] ;
140139
You can’t perform that action at this time.
0 commit comments