Skip to content

Commit eca75b3

Browse files
committed
Comment and formatted on windows rust_file call
1 parent 0daa038 commit eca75b3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

vm/src/stdlib/os.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,14 @@ pub fn raw_file_number(handle: File) -> i32 {
3838

3939
#[cfg(target_family = "windows")]
4040
pub fn rust_file(raw_fileno: i32) -> File {
41+
use std::ffi::c_void;
4142
use std::os::windows::io::FromRawHandle;
42-
use std::ffi::c_void;
4343

44-
unsafe { File::from_raw_handle(raw_fileno as *mut c_void)}
44+
//TODO: This is untested and (very) unsafe handling or
45+
//raw pointers - This should be patched as a matter of
46+
//urgently patched by comparison to the cpython handling of
47+
//the equivalent fileno fields for windows
48+
unsafe { File::from_raw_handle(raw_fileno as *mut c_void) }
4549
}
4650

4751
pub fn os_close(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {

0 commit comments

Comments
 (0)