Skip to content

Commit 9146600

Browse files
committed
Propogate
1 parent e53addf commit 9146600

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/singledispatch/mro.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff 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

122121
fn 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

0 commit comments

Comments
 (0)