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

Method with_filename_from_errno

crates/vm/src/ospath.rs:335–346  ·  view source on GitHub ↗
(
        error: &std::io::Error,
        filename: impl Into<OsPathOrFd<'a>>,
        vm: &VirtualMachine,
    )

Source from the content-addressed store, hash-verified

333 /// `[Errno X]` format instead of `[WinError X]`.
334 #[must_use]
335 pub(crate) fn with_filename_from_errno<'a>(
336 error: &std::io::Error,
337 filename: impl Into<OsPathOrFd<'a>>,
338 vm: &VirtualMachine,
339 ) -> crate::builtins::PyBaseExceptionRef {
340 use crate::exceptions::ToOSErrorBuilder;
341 let builder = error.to_os_error_builder(vm);
342 #[cfg(windows)]
343 let builder = builder.without_winerror();
344 let builder = builder.filename(filename.into().filename(vm));
345 builder.build(vm).upcast()
346 }
347}

Callers

nothing calls this directly

Calls 5

to_os_error_builderMethod · 0.80
without_winerrorMethod · 0.80
upcastMethod · 0.80
filenameMethod · 0.45
buildMethod · 0.45

Tested by

no test coverage detected