Skip to content

Commit 7448f8f

Browse files
committed
more const
1 parent 8ad7f91 commit 7448f8f

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

Lib/test/test_os.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2102,7 +2102,6 @@ def test_urandom_failure(self):
21022102
"""
21032103
assert_python_ok('-c', code)
21042104

2105-
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON; on Windows (ModuleNotFoundError: No module named 'os')")
21062105
def test_urandom_fd_closed(self):
21072106
# Issue #21207: urandom() should reopen its fd to /dev/urandom if
21082107
# closed.

crates/vm/src/stdlib/nt.rs

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,31 @@ pub(crate) mod module {
3535
};
3636

3737
#[pyattr]
38-
use libc::{O_BINARY, O_TEMPORARY};
38+
use libc::{O_BINARY, O_NOINHERIT, O_RANDOM, O_SEQUENTIAL, O_TEMPORARY, O_TEXT};
39+
40+
// Windows spawn mode constants
41+
#[pyattr]
42+
const P_WAIT: i32 = 0;
43+
#[pyattr]
44+
const P_NOWAIT: i32 = 1;
45+
#[pyattr]
46+
const P_OVERLAY: i32 = 2;
47+
#[pyattr]
48+
const P_NOWAITO: i32 = 3;
49+
#[pyattr]
50+
const P_DETACH: i32 = 4;
51+
52+
// _O_SHORT_LIVED is not in libc, define manually
53+
#[pyattr]
54+
const O_SHORT_LIVED: i32 = 0x1000;
55+
56+
// Exit code constant
57+
#[pyattr]
58+
const EX_OK: i32 = 0;
59+
60+
// Maximum number of temporary files
61+
#[pyattr]
62+
const TMP_MAX: i32 = i32::MAX;
3963

4064
#[pyattr]
4165
use windows_sys::Win32::System::LibraryLoader::{

0 commit comments

Comments
 (0)