diff --git a/src/ffi/mod.rs b/src/ffi/mod.rs index 98ce4ea3..97994caa 100644 --- a/src/ffi/mod.rs +++ b/src/ffi/mod.rs @@ -22,6 +22,7 @@ pub use self::codecs::*; pub use self::compile::*; pub use self::complexobject::*; pub use self::context::*; +#[cfg(not(Py_LIMITED_API))] pub use self::datetime::*; pub use self::descrobject::*; pub use self::dictobject::*; @@ -178,6 +179,7 @@ pub mod frameobject { opaque_struct!(PyFrameObject); } +#[cfg(not(Py_LIMITED_API))] pub(crate) mod datetime; pub(crate) mod marshal; diff --git a/src/types/mod.rs b/src/types/mod.rs index 918f2ae5..4c12d5f0 100644 --- a/src/types/mod.rs +++ b/src/types/mod.rs @@ -7,9 +7,9 @@ pub use self::boolobject::PyBool; pub use self::bytearray::PyByteArray; pub use self::bytes::PyBytes; pub use self::complex::PyComplex; -pub use self::datetime::PyDeltaAccess; +#[cfg(not(Py_LIMITED_API))] pub use self::datetime::{ - PyDate, PyDateAccess, PyDateTime, PyDelta, PyTime, PyTimeAccess, PyTzInfo, + PyDate, PyDateAccess, PyDateTime, PyDelta, PyDeltaAccess, PyTime, PyTimeAccess, PyTzInfo, }; pub use self::dict::{IntoPyDict, PyDict}; pub use self::floatob::PyFloat; @@ -231,6 +231,7 @@ mod boolobject; mod bytearray; mod bytes; mod complex; +#[cfg(not(Py_LIMITED_API))] mod datetime; mod dict; mod floatob; diff --git a/tests/test_datetime.rs b/tests/test_datetime.rs index a3867562..ef1709e2 100644 --- a/tests/test_datetime.rs +++ b/tests/test_datetime.rs @@ -1,3 +1,5 @@ +#![cfg(not(Py_LIMITED_API))] + use pyo3::prelude::*; use pyo3::types::IntoPyDict;