Skip to content

Commit

Permalink
Avoid clone in PyErr::from_value_bound
Browse files Browse the repository at this point in the history
  • Loading branch information
LilyFoote committed Feb 12, 2024
1 parent cd84004 commit 00c6028
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/err/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@ impl PyErr {
} else {
// Assume obj is Type[Exception]; let later normalization handle if this
// is not the case
PyErrState::lazy_bound(obj.clone(), obj.py().None())
let none = obj.py().None();
PyErrState::lazy_bound(obj, none)
};

PyErr::from_state(state)
Expand Down

0 comments on commit 00c6028

Please sign in to comment.