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