Skip to content

Commit 401ab90

Browse files
committed
Fix unwrap issue causing panic
1 parent d1811c7 commit 401ab90

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

vm/src/suggestion.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub fn offer_suggestions(exc: &PyBaseExceptionRef, vm: &VirtualMachine) -> Optio
5252
calculate_suggestions(vm.dir(Some(obj)).ok()?.borrow_vec().iter(), &name)
5353
} else if exc.class().is(vm.ctx.exceptions.name_error) {
5454
let name = exc.as_object().to_owned().get_attr("name", vm).unwrap();
55-
let mut tb = exc.traceback().unwrap();
55+
let mut tb = exc.traceback()?;
5656
for traceback in tb.iter() {
5757
tb = traceback;
5858
}

0 commit comments

Comments
 (0)