Skip to content

Commit b85ad73

Browse files
committed
Propogate
1 parent 32ec98f commit b85ad73

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
@@ -98,22 +98,21 @@ impl C3Mro<'_> {
9898
}
9999
}
100100

101-
fn c3_boundary(py: Python, bases: &[PyTypeReference]) -> usize {
101+
fn c3_boundary(py: Python, bases: &[PyTypeReference]) -> PyResult<usize> {
102102
let mut boundary = 0;
103103

104104
for (i, base) in bases.iter().rev().enumerate() {
105105
if base
106106
.wrapped()
107107
.bind(py)
108-
.hasattr(intern!(py, "__abstractmethods__"))
109-
.unwrap()
108+
.hasattr(intern!(py, "__abstractmethods__"))?
110109
{
111110
boundary = bases.len() - i;
112111
break;
113112
}
114113
}
115114

116-
boundary
115+
Ok(boundary)
117116
}
118117

119118
fn c3_mro(
@@ -131,7 +130,7 @@ fn c3_mro(
131130
}
132131
Err(e) => return Err(e),
133132
};
134-
let boundary = c3_boundary(py, &bases);
133+
let boundary = c3_boundary(py, &bases)?;
135134
eprintln!("boundary = {boundary}");
136135
let base = &bases[boundary];
137136

0 commit comments

Comments
 (0)