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 @@ -98,22 +98,21 @@ impl C3Mro<'_> {
98
98
}
99
99
}
100
100
101
- fn c3_boundary ( py : Python , bases : & [ PyTypeReference ] ) -> usize {
101
+ fn c3_boundary ( py : Python , bases : & [ PyTypeReference ] ) -> PyResult < usize > {
102
102
let mut boundary = 0 ;
103
103
104
104
for ( i, base) in bases. iter ( ) . rev ( ) . enumerate ( ) {
105
105
if base
106
106
. wrapped ( )
107
107
. bind ( py)
108
- . hasattr ( intern ! ( py, "__abstractmethods__" ) )
109
- . unwrap ( )
108
+ . hasattr ( intern ! ( py, "__abstractmethods__" ) ) ?
110
109
{
111
110
boundary = bases. len ( ) - i;
112
111
break ;
113
112
}
114
113
}
115
114
116
- boundary
115
+ Ok ( boundary)
117
116
}
118
117
119
118
fn c3_mro (
@@ -131,7 +130,7 @@ fn c3_mro(
131
130
}
132
131
Err ( e) => return Err ( e) ,
133
132
} ;
134
- let boundary = c3_boundary ( py, & bases) ;
133
+ let boundary = c3_boundary ( py, & bases) ? ;
135
134
eprintln ! ( "boundary = {boundary}" ) ;
136
135
let base = & bases[ boundary] ;
137
136
You can’t perform that action at this time.
0 commit comments