Skip to content

Commit 522ebee

Browse files
authored
Merge pull request #1260 from aviramha/fix_pycodeobj_struct
Fix PyCodeObject struct
2 parents 33ec5b5 + c982639 commit 522ebee

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
77

88
## [Unreleased]
9+
### Fixed
10+
- 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)
911
### Packaging
1012
- Drop support for Python 3.5 (as it is now end-of-life). [#1250](https://github.com/PyO3/pyo3/pull/1250)
1113

src/ffi/code.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ pub enum _PyOpcache {}
1010
pub struct PyCodeObject {
1111
pub ob_base: PyObject,
1212
pub co_argcount: c_int,
13+
#[cfg(Py_3_8)]
14+
pub co_posonlyargcount: c_int,
1315
pub co_kwonlyargcount: c_int,
1416
pub co_nlocals: c_int,
1517
pub co_stacksize: c_int,

0 commit comments

Comments
 (0)