Skip to content

Commit 739a885

Browse files
authored
Merge pull request #1791 from indygreg/fix-pystatus
ffi: fix PyStatus._type
2 parents 254ea53 + 150f4ad commit 739a885

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1515
### Fixed
1616

1717
- Restrict FFI definitions `PyGILState_Check` and `Py_tracefunc` to the unlimited API. [#1787](https://github.com/PyO3/pyo3/pull/1787)
18+
- Add missing `_type` field to `PyStatus` struct definition. [#1791](https://github.com/PyO3/pyo3/pull/1791)
1819

1920
## [0.14.2] - 2021-08-09
2021

src/ffi/cpython/initconfig.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use crate::ffi::Py_ssize_t;
44
use libc::wchar_t;
55
use std::os::raw::{c_char, c_int, c_ulong};
66

7+
#[repr(C)]
78
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
89
pub enum _PyStatus_TYPE {
910
_PyStatus_TYPE_OK = 0,
@@ -14,6 +15,7 @@ pub enum _PyStatus_TYPE {
1415
#[repr(C)]
1516
#[derive(Copy, Clone)]
1617
pub struct PyStatus {
18+
pub _type: _PyStatus_TYPE,
1719
pub func: *const c_char,
1820
pub err_msg: *const c_char,
1921
pub exitcode: c_int,

0 commit comments

Comments
 (0)