Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions newsfragments/5109.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add `#[track_caller]` to `with_gil` and `with_gil_unchecked`.
2 changes: 2 additions & 0 deletions src/marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ impl Python<'_> {
///
/// [`auto-initialize`]: https://pyo3.rs/main/features.html#auto-initialize
#[inline]
#[track_caller]
pub fn with_gil<F, R>(f: F) -> R
where
F: for<'py> FnOnce(Python<'py>) -> R,
Expand Down Expand Up @@ -433,6 +434,7 @@ impl Python<'_> {
///
/// Behavior in other scenarios is not documented.
#[inline]
#[track_caller]
pub unsafe fn with_gil_unchecked<F, R>(f: F) -> R
where
F: for<'py> FnOnce(Python<'py>) -> R,
Expand Down
Loading