We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c6c1e7f + 252c3be commit 3d4fd5fCopy full SHA for 3d4fd5f
tests/snippets/os_info.py
@@ -0,0 +1,3 @@
1
+import os
2
+
3
+assert os.name == 'posix'
vm/src/stdlib/os.rs
@@ -121,5 +121,13 @@ pub fn mk_module(ctx: &PyContext) -> PyObjectRef {
121
ctx.set_attr(&py_mod, "O_NONBLOCK", ctx.new_int(4));
122
ctx.set_attr(&py_mod, "O_APPEND", ctx.new_int(8));
123
ctx.set_attr(&py_mod, "O_CREAT", ctx.new_int(512));
124
125
+ if cfg!(windows) {
126
+ ctx.set_attr(&py_mod, "name", ctx.new_str("nt".to_string()));
127
+ } else {
128
+ // Assume we're on a POSIX system
129
+ ctx.set_attr(&py_mod, "name", ctx.new_str("posix".to_string()));
130
+ }
131
132
py_mod
133
}
0 commit comments