This instance will be upgraded to Heptapod 0.21.0rc3 on 2021-04-23 at 10:30 UTC+2 (a few minutes of down time)

Commit ac1e79ed authored by Raphaël Gomès's avatar Raphaël Gomès

rust-status: properly translate OSError to Python

This is probably never going to be called after the next few patches, but we
might as well make sure this is done correctly for the future rewrite.

Differential Revision:
parent 073bb7563931
......@@ -10,6 +10,7 @@
//! `rustext.dirstate.status`.
use crate::{dirstate::DirstateMap, exceptions::FallbackError};
use cpython::exc::OSError;
use cpython::{
exc::ValueError, ObjectProtocol, PyBytes, PyErr, PyList, PyObject,
PyResult, PyTuple, Python, PythonObject, ToPyObject,
......@@ -89,6 +90,7 @@ fn handle_fallback(py: Python, err: StatusError) -> PyErr {
PyErr::new::<FallbackError, _>(py, &as_string)
StatusError::IO(e) => PyErr::new::<OSError, _>(py, e.to_string()),
e => PyErr::new::<ValueError, _>(py, e.to_string()),
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment