From c80a61ee30575d30a3ded7e1674b3b313e27536c Mon Sep 17 00:00:00 2001 From: David Hewitt <1939362+davidhewitt@users.noreply.github.com> Date: Mon, 2 Oct 2023 21:36:17 +0100 Subject: [PATCH] disable `marshal.rs` on `Py_LIMITED_API` --- newsfragments/3490.fixed.md | 1 + pyo3-ffi/src/lib.rs | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 newsfragments/3490.fixed.md diff --git a/newsfragments/3490.fixed.md b/newsfragments/3490.fixed.md new file mode 100644 index 00000000..b7cf1db8 --- /dev/null +++ b/newsfragments/3490.fixed.md @@ -0,0 +1 @@ +Disable `PyMarshal_WriteObjectToString` from `PyMarshal_ReadObjectFromString` with the `abi3` feature. diff --git a/pyo3-ffi/src/lib.rs b/pyo3-ffi/src/lib.rs index cae3001d..cddf53e0 100644 --- a/pyo3-ffi/src/lib.rs +++ b/pyo3-ffi/src/lib.rs @@ -281,6 +281,7 @@ pub use self::intrcheck::*; pub use self::iterobject::*; pub use self::listobject::*; pub use self::longobject::*; +#[cfg(not(Py_LIMITED_API))] pub use self::marshal::*; pub use self::memoryobject::*; pub use self::methodobject::*; @@ -351,7 +352,8 @@ mod iterobject; mod listobject; // skipped longintrepr.h mod longobject; -pub(crate) mod marshal; +#[cfg(not(Py_LIMITED_API))] +pub mod marshal; mod memoryobject; mod methodobject; mod modsupport;