Skip to content

Commit

Permalink
fix build error on GIL-enabled build
Browse files Browse the repository at this point in the history
  • Loading branch information
ngoldbaum committed Dec 10, 2024
1 parent 3e36556 commit d74b908
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/types/dict.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,10 +512,17 @@ impl<'py> Iterator for BoundDictIterator<'py> {

#[inline]
fn next(&mut self) -> Option<Self::Item> {
self.inner
.with_critical_section(&self.dict, |inner| unsafe {
inner.next_unchecked(&self.dict)
})
#[cfg(Py_GIL_DISABLED)]
{
self.inner
.with_critical_section(&self.dict, |inner| unsafe {
inner.next_unchecked(&self.dict)
})
}
#[cfg(not(Py_GIL_DISABLED))]
{
unsafe { self.inner.next_unchecked(&self.dict) }
}
}

#[inline]
Expand Down

0 comments on commit d74b908

Please sign in to comment.