From 11f2a1270654c024c5e6d574bfb0a5445a9954e7 Mon Sep 17 00:00:00 2001 From: Nathan Goldbaum Date: Mon, 21 Oct 2024 18:36:12 -0600 Subject: [PATCH] fix clippy and msrc --- pyo3-macros-backend/src/module.rs | 3 ++- src/types/module.rs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pyo3-macros-backend/src/module.rs b/pyo3-macros-backend/src/module.rs index 9537d66ac41..caa42a22ae8 100644 --- a/pyo3-macros-backend/src/module.rs +++ b/pyo3-macros-backend/src/module.rs @@ -355,7 +355,8 @@ pub fn pymodule_module_impl( options.submodule.is_some(), options .supports_free_threaded - .is_some_and(|op| op.value.value), + .map(|op| op.value.value) + .unwrap_or(false), ); Ok(quote!( diff --git a/src/types/module.rs b/src/types/module.rs index cc864711111..e0069096d18 100644 --- a/src/types/module.rs +++ b/src/types/module.rs @@ -560,6 +560,7 @@ impl<'py> PyModuleMethods<'py> for Bound<'py, PyModule> { 0..=c_int::MAX => Ok(()), } } + #[cfg(any(Py_LIMITED_API, not(Py_GIL_DISABLED)))] Ok(()) } }