MCPcopy Index your code
hub / github.com/RustPython/RustPython / io_error

Method io_error

crates/vm/src/stdlib/_io.rs:5645–5657  ·  view source on GitHub ↗
(
            zelf: &Py<Self>,
            error: std::io::Error,
            vm: &VirtualMachine,
        )

Source from the content-addressed store, hash-verified

5643 )]
5644 impl FileIO {
5645 fn io_error(
5646 zelf: &Py<Self>,
5647 error: std::io::Error,
5648 vm: &VirtualMachine,
5649 ) -> PyBaseExceptionRef {
5650 let exc = error.to_pyexception(vm);
5651 if let Ok(name) = zelf.as_object().get_attr("name", vm) {
5652 exc.as_object()
5653 .set_attr("filename", name, vm)
5654 .expect("OSError.filename set must success");
5655 }
5656 exc
5657 }
5658
5659 #[pygetset]
5660 fn closed(&self) -> bool {

Callers 1

convert_ssl_errorFunction · 0.80

Calls 4

to_pyexceptionMethod · 0.45
get_attrMethod · 0.45
as_objectMethod · 0.45
set_attrMethod · 0.45

Tested by

no test coverage detected