Comment and formatted on windows rust_file call

This commit is contained in:
rmliddle
2019-02-05 22:18:24 +11:00
parent 0daa03875c
commit eca75b3611

View File

@@ -38,10 +38,14 @@ pub fn raw_file_number(handle: File) -> i32 {
#[cfg(target_family = "windows")]
pub fn rust_file(raw_fileno: i32) -> File {
use std::ffi::c_void;
use std::os::windows::io::FromRawHandle;
use std::ffi::c_void;
unsafe { File::from_raw_handle(raw_fileno as *mut c_void)}
//TODO: This is untested and (very) unsafe handling or
//raw pointers - This should be patched as a matter of
//urgently patched by comparison to the cpython handling of
//the equivalent fileno fields for windows
unsafe { File::from_raw_handle(raw_fileno as *mut c_void) }
}
pub fn os_close(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {