Skip to content

Commit 8d96a6b

Browse files
committed
Avoid WASI build error by not using errno::errors
1 parent 2572890 commit 8d96a6b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

vm/src/exceptions.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,6 +1441,7 @@ pub(super) mod types {
14411441
PyBaseException::slot_new(cls, args, vm)
14421442
}
14431443

1444+
#[cfg(not(target_arch = "wasm32"))]
14441445
fn os_error_new(cls: PyTypeRef, args: FuncArgs, vm: &VirtualMachine) -> PyResult {
14451446
// We need this method, because of how `CPython` copies `init`
14461447
// from `BaseException` in `SimpleExtendsException` macro.
@@ -1454,6 +1455,12 @@ pub(super) mod types {
14541455
PyBaseException::slot_new(cls, args, vm)
14551456
}
14561457
}
1458+
1459+
#[cfg(target_arch = "wasm32")]
1460+
fn os_error_new(cls: PyTypeRef, args: FuncArgs, vm: &VirtualMachine) -> PyResult {
1461+
PyBaseException::slot_new(cls, args, vm)
1462+
}
1463+
14571464
fn base_exception_init(
14581465
zelf: PyRef<PyBaseException>,
14591466
args: FuncArgs,

0 commit comments

Comments
 (0)