diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b98cb74a1b..c193ee93299 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Fixed +- Fix missing field in `PyCodeObject` struct (`co_posonlyargcount`) - caused invalid access to other fields in Python >3.7. [#1260](https://github.com/PyO3/pyo3/pull/1260) ### Packaging - Drop support for Python 3.5 (as it is now end-of-life). [#1250](https://github.com/PyO3/pyo3/pull/1250) diff --git a/src/ffi/code.rs b/src/ffi/code.rs index 643e0652947..25c656ebd25 100644 --- a/src/ffi/code.rs +++ b/src/ffi/code.rs @@ -10,6 +10,8 @@ pub enum _PyOpcache {} pub struct PyCodeObject { pub ob_base: PyObject, pub co_argcount: c_int, + #[cfg(Py_3_8)] + pub co_posonlyargcount: c_int, pub co_kwonlyargcount: c_int, pub co_nlocals: c_int, pub co_stacksize: c_int,