feature gate deprecated APIs for `PyBool` (#4159)

This commit is contained in:
Icxolu 2024-05-04 19:45:27 +02:00 committed by GitHub
parent ef13bc66e9
commit 7263fa92ef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 6 deletions

View File

@ -16,12 +16,10 @@ pyobject_native_type!(PyBool, ffi::PyObject, pyobject_native_static_type_object!
impl PyBool {
/// Deprecated form of [`PyBool::new_bound`]
#[cfg_attr(
not(feature = "gil-refs"),
deprecated(
#[cfg(feature = "gil-refs")]
#[deprecated(
since = "0.21.0",
note = "`PyBool::new` will be replaced by `PyBool::new_bound` in a future PyO3 version"
)
)]
#[inline]
pub fn new(py: Python<'_>, val: bool) -> &PyBool {