Skip to content

Commit 7263fa9

Browse files
authored
feature gate deprecated APIs for PyBool (#4159)
1 parent ef13bc6 commit 7263fa9

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/types/boolobject.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,10 @@ pyobject_native_type!(PyBool, ffi::PyObject, pyobject_native_static_type_object!
1616

1717
impl PyBool {
1818
/// Deprecated form of [`PyBool::new_bound`]
19-
#[cfg_attr(
20-
not(feature = "gil-refs"),
21-
deprecated(
22-
since = "0.21.0",
23-
note = "`PyBool::new` will be replaced by `PyBool::new_bound` in a future PyO3 version"
24-
)
19+
#[cfg(feature = "gil-refs")]
20+
#[deprecated(
21+
since = "0.21.0",
22+
note = "`PyBool::new` will be replaced by `PyBool::new_bound` in a future PyO3 version"
2523
)]
2624
#[inline]
2725
pub fn new(py: Python<'_>, val: bool) -> &PyBool {

0 commit comments

Comments
 (0)