Skip to content

Commit

Permalink
Merge pull request #1260 from aviramha/fix_pycodeobj_struct
Browse files Browse the repository at this point in the history
Fix PyCodeObject struct
  • Loading branch information
davidhewitt authored Oct 25, 2020
2 parents 33ec5b5 + c982639 commit 522ebee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 2 additions & 0 deletions src/ffi/code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 522ebee

Please sign in to comment.