Skip to content

Commit

Permalink
rust: clippy fixes 1.59
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhewitt authored and messense committed Mar 31, 2022
1 parent b96a3f7 commit 54de029
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/gil.rs
Original file line number Diff line number Diff line change
Expand Up @@ -704,16 +704,14 @@ mod tests {
assert!(gil_is_acquired());
}

#[allow(clippy::needless_late_init)]
#[test]
fn dropping_gil_does_not_invalidate_references() {
// Acquiring GIL for the second time should be safe - see #864
let gil = Python::acquire_gil();
let py = gil.python();
let obj;

let gil2 = Python::acquire_gil();
obj = py.eval("object()", None, None).unwrap();
let obj = py.eval("object()", None, None).unwrap();
drop(gil2);

// After gil2 drops, obj should still have a reference count of one
Expand Down

0 comments on commit 54de029

Please sign in to comment.