Skip to content

Commit caa4722

Browse files
committed
macos fix
1 parent f7d918a commit caa4722

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

vm/src/stdlib/os.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,9 +1217,7 @@ fn extend_module_platform_specific(vm: &VirtualMachine, module: PyObjectRef) ->
12171217
"ttyname" => ctx.new_rustfunc(os_ttyname),
12181218
"SEEK_SET" => ctx.new_int(Whence::SeekSet as i8),
12191219
"SEEK_CUR" => ctx.new_int(Whence::SeekCur as i8),
1220-
"SEEK_END" => ctx.new_int(Whence::SeekEnd as i8),
1221-
"SEEK_DATA" => ctx.new_int(Whence::SeekData as i8),
1222-
"SEEK_HOLE" => ctx.new_int(Whence::SeekHole as i8)
1220+
"SEEK_END" => ctx.new_int(Whence::SeekEnd as i8)
12231221
});
12241222

12251223
#[cfg(not(target_os = "redox"))]
@@ -1231,6 +1229,12 @@ fn extend_module_platform_specific(vm: &VirtualMachine, module: PyObjectRef) ->
12311229
"openpty" => ctx.new_rustfunc(os_openpty),
12321230
});
12331231

1232+
#[cfg(not(target_os = "macos"))]
1233+
extend_module!(vm, module, {
1234+
"SEEK_DATA" => ctx.new_int(Whence::SeekData as i8),
1235+
"SEEK_HOLE" => ctx.new_int(Whence::SeekHole as i8)
1236+
});
1237+
12341238
module
12351239
}
12361240

0 commit comments

Comments
 (0)