(vm: &VirtualMachine, err: Errno)
| 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). |
no test coverage detected