feature gate deprecated APIs for `marshal` (#4149)

This commit is contained in:
Icxolu 2024-05-03 20:15:25 +02:00 committed by GitHub
parent f3ab62cb7e
commit c08f6c77a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 12 deletions

View File

@ -13,12 +13,10 @@ use std::os::raw::c_int;
pub const VERSION: i32 = 4;
/// Deprecated form of [`dumps_bound`]
#[cfg_attr(
not(feature = "gil-refs"),
deprecated(
since = "0.21.0",
note = "`dumps` will be replaced by `dumps_bound` in a future PyO3 version"
)
#[cfg(feature = "gil-refs")]
#[deprecated(
since = "0.21.0",
note = "`dumps` will be replaced by `dumps_bound` in a future PyO3 version"
)]
pub fn dumps<'py>(
py: Python<'py>,
@ -61,12 +59,10 @@ pub fn dumps_bound<'py>(
}
/// Deprecated form of [`loads_bound`]
#[cfg_attr(
not(feature = "gil-refs"),
deprecated(
since = "0.21.0",
note = "`loads` will be replaced by `loads_bound` in a future PyO3 version"
)
#[cfg(feature = "gil-refs")]
#[deprecated(
since = "0.21.0",
note = "`loads` will be replaced by `loads_bound` in a future PyO3 version"
)]
pub fn loads<'py, B>(py: Python<'py>, data: &B) -> PyResult<&'py PyAny>
where