(
error: &std::io::Error,
filename: impl Into<OsPathOrFd<'a>>,
vm: &VirtualMachine,
)
| 317 | impl crate::exceptions::OSErrorBuilder { |
| 318 | #[must_use] |
| 319 | pub(crate) fn with_filename<'a>( |
| 320 | error: &std::io::Error, |
| 321 | filename: impl Into<OsPathOrFd<'a>>, |
| 322 | vm: &VirtualMachine, |
| 323 | ) -> crate::builtins::PyBaseExceptionRef { |
| 324 | // TODO: return type to PyRef<PyOSError> |
| 325 | use crate::exceptions::ToOSErrorBuilder; |
| 326 | let builder = error.to_os_error_builder(vm); |
| 327 | let builder = builder.filename(filename.into().filename(vm)); |
| 328 | builder.build(vm).upcast() |
| 329 | } |
| 330 | |
| 331 | /// Like `with_filename`, but strips winerror on Windows. |
| 332 | /// Use for C runtime errors (open, fstat, etc.) that should produce |
nothing calls this directly
no test coverage detected