Skip to content

Commit af7a89a

Browse files
committed
pop exception on context
1 parent f1551af commit af7a89a

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

vm/src/frame.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -739,8 +739,8 @@ impl Frame {
739739
};
740740
let context = match argc {
741741
0 => vm.get_none(), // We have already got the exception,
742-
_ => match vm.last_exception() {
743-
Some(exc) => exc.clone(),
742+
_ => match vm.pop_exception() {
743+
Some(exc) => exc,
744744
None => vm.get_none(),
745745
},
746746
};

vm/src/vm.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -931,17 +931,6 @@ impl VirtualMachine {
931931
pub fn pop_exception(&self) -> Option<PyObjectRef> {
932932
self.exceptions.borrow_mut().pop()
933933
}
934-
935-
pub fn last_exception(&self) -> Option<Ref<PyObjectRef>> {
936-
let exceptions = self.exceptions.borrow();
937-
if exceptions.is_empty() {
938-
None
939-
} else {
940-
Some(Ref::map(self.exceptions.borrow(), |exceptions| {
941-
exceptions.last().unwrap()
942-
}))
943-
}
944-
}
945934
}
946935

947936
impl Default for VirtualMachine {

0 commit comments

Comments
 (0)