Use #[cfg(not(Py_LIMITED_API))] for datetime API

This commit is contained in:
kngwyu 2020-12-16 00:04:40 +09:00 committed by David Hewitt
parent df3826b652
commit dc2dbd6c19
3 changed files with 7 additions and 2 deletions

View File

@ -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;

View File

@ -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;

View File

@ -1,3 +1,5 @@
#![cfg(not(Py_LIMITED_API))]
use pyo3::prelude::*;
use pyo3::types::IntoPyDict;