Skip to content

Commit

Permalink
feature gate deprecated APIs for PyBool
Browse files Browse the repository at this point in the history
  • Loading branch information
Icxolu committed May 4, 2024
1 parent ef13bc6 commit c01e01e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/types/boolobject.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
since = "0.21.0",
note = "`PyBool::new` will be replaced by `PyBool::new_bound` in a future PyO3 version"
)
#[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 {
Expand Down

0 comments on commit c01e01e

Please sign in to comment.