Skip to content

Commit

Permalink
Merge pull request #1533 from davidhewitt/pypy-exceptions
Browse files Browse the repository at this point in the history
pypy: support EnvironmentError, IOError, WindowsError
  • Loading branch information
messense committed Mar 31, 2021
2 parents 3663d3f + e035b2a commit 4713b46
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
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

0 comments on commit 4713b46

Please sign in to comment.