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

Function os_error

crates/stdlib/src/multiprocessing.rs:1132–1141  ·  view source on GitHub ↗
(vm: &VirtualMachine, err: Errno)

Source from the content-addressed store, hash-verified

1130 }
1131
1132 fn os_error(vm: &VirtualMachine, err: Errno) -> PyBaseExceptionRef {
1133 // _PyMp_SetError maps to PyErr_SetFromErrno
1134 let exc_type = match err {
1135 Errno::EEXIST => vm.ctx.exceptions.file_exists_error.to_owned(),
1136 Errno::ENOENT => vm.ctx.exceptions.file_not_found_error.to_owned(),
1137 _ => vm.ctx.exceptions.os_error.to_owned(),
1138 };
1139 vm.new_os_subtype_error(exc_type, Some(err as i32), err.desc().to_owned())
1140 .upcast()
1141 }
1142
1143 /// Get current thread identifier.
1144 /// PyThread_get_thread_ident on Unix (pthread_self).

Callers 8

createMethod · 0.85
open_existingMethod · 0.85
acquireMethod · 0.85
releaseMethod · 0.85
_get_valueMethod · 0.85
_is_zeroMethod · 0.85
sem_unlinkFunction · 0.85
handle_wait_errorFunction · 0.85

Calls 4

upcastMethod · 0.80
new_os_subtype_errorMethod · 0.80
SomeClass · 0.50
to_ownedMethod · 0.45

Tested by

no test coverage detected