Skip to content

Commit

Permalink
Avoid .as_any call with Py api instead of Bound
Browse files Browse the repository at this point in the history
  • Loading branch information
LilyFoote committed Feb 17, 2024
1 parent 8d18475 commit 1a98cbd
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions tests/test_class_basics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,7 @@ fn test_unsendable<T: PyClass + 'static>() -> PyResult<()> {
// Accessing the value inside this thread should not panic
let caught_panic =
std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| -> PyResult<_> {
assert_eq!(
obj.bind(py).as_any().getattr("value")?.extract::<usize>()?,
5
);
assert_eq!(obj.getattr(py, "value")?.extract::<usize>(py)?, 5);
Ok(())
}))
.is_err();
Expand Down

0 comments on commit 1a98cbd

Please sign in to comment.