Skip to content

Commit

Permalink
fix free-threaded clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
ngoldbaum committed Oct 22, 2024
1 parent e90f4cb commit 8ebc9f9
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/impl_/pymodule.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//! Implementation details of `#[pymodule]` which need to be accessible from proc-macro generated code.
#[cfg(all(not(Py_LIMITED_API), Py_GIL_DISABLED))]
use std::os::raw::c_int;
use std::{cell::UnsafeCell, ffi::CStr, marker::PhantomData};

#[cfg(all(
Expand Down Expand Up @@ -156,10 +154,9 @@ impl ModuleDef {
ffi::Py_MOD_GIL_USED
}
};
match unsafe { ffi::PyUnstable_Module_SetGIL(module.as_ptr(), gil_used) } {
c_int::MIN..=-1 => return Err(PyErr::fetch(py)),
0..=c_int::MAX => {}
};
if unsafe { ffi::PyUnstable_Module_SetGIL(module.as_ptr(), gil_used) } < 0 {
return Err(PyErr::fetch(py));
}
}
self.initializer.0(module.bind(py))?;
Ok(module)
Expand Down

0 comments on commit 8ebc9f9

Please sign in to comment.