Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pypy: support EnvironmentError, IOError, WindowsError #1533

Merged
merged 1 commit into from
Mar 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fix inability to add `#[text_signature]` to some `#[pyproto]` methods. [#1483](https://github.com/PyO3/pyo3/pull/1483)
- Fix use of Python argument for #[pymethods] inside macro expansions. [#1505](https://github.com/PyO3/pyo3/pull/1505)
- Always use cross-compiling configuration if any of the environment variables are set. [#1514](https://github.com/PyO3/pyo3/pull/1514)
- Support `EnvironmentError`, `IOError`, and `WindowsError` on PyPy. [#1533](https://github.com/PyO3/pyo3/pull/1533)

## [0.13.2] - 2021-02-12
### Packaging
Expand Down
4 changes: 1 addition & 3 deletions src/exceptions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,11 +274,9 @@ impl_native_exception!(PyPermissionError, PyExc_PermissionError);
impl_native_exception!(PyProcessLookupError, PyExc_ProcessLookupError);
impl_native_exception!(PyTimeoutError, PyExc_TimeoutError);

#[cfg(not(all(windows, PyPy)))]
impl_native_exception!(PyEnvironmentError, PyExc_EnvironmentError);
#[cfg(not(all(windows, PyPy)))]
impl_native_exception!(PyIOError, PyExc_IOError);
#[cfg(all(windows, not(PyPy)))]
#[cfg(windows)]
impl_native_exception!(PyWindowsError, PyExc_WindowsError);

impl PyUnicodeDecodeError {
Expand Down
7 changes: 4 additions & 3 deletions src/ffi/pyerrors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,11 +283,12 @@ extern "C" {
#[cfg_attr(PyPy, link_name = "PyPyExc_TimeoutError")]
pub static mut PyExc_TimeoutError: *mut PyObject;

#[cfg(not(all(windows, PyPy)))]
#[cfg_attr(PyPy, link_name = "PyPyExc_OSError")]
pub static mut PyExc_EnvironmentError: *mut PyObject;
#[cfg(not(all(windows, PyPy)))]
#[cfg_attr(PyPy, link_name = "PyPyExc_OSError")]
pub static mut PyExc_IOError: *mut PyObject;
#[cfg(all(windows, not(PyPy)))]
#[cfg(windows)]
#[cfg_attr(PyPy, link_name = "PyPyExc_OSError")]
pub static mut PyExc_WindowsError: *mut PyObject;

pub static mut PyExc_RecursionErrorInst: *mut PyObject;
Expand Down