Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 06e9cb7

Browse filesBrowse files
committed
temp
1 parent 7047fb5 commit 06e9cb7
Copy full SHA for 06e9cb7

File tree

1 file changed

+17
-8
lines changed
Filter options

1 file changed

+17
-8
lines changed

‎vm/src/vm/mod.rs

Copy file name to clipboardExpand all lines: vm/src/vm/mod.rs
+17-8Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -388,14 +388,23 @@ impl VirtualMachine {
388388
if expect_stdlib {
389389
// enable python-implemented ExceptionGroup when stdlib exists
390390
let py_core_init = || -> PyResult<()> {
391-
let exception_group = import::import_frozen(self, "_py_exceptiongroup")?;
392-
let base_exception_group = exception_group.get_attr("BaseExceptionGroup", self)?;
393-
self.builtins
394-
.set_attr("BaseExceptionGroup", base_exception_group, self)?;
395-
let exception_group = exception_group.get_attr("ExceptionGroup", self)?;
396-
self.builtins
397-
.set_attr("ExceptionGroup", exception_group, self)?;
398-
Ok(())
391+
#[cfg(target_arch = "wasm32")]
392+
{
393+
// Skip exceptiongroup for WebAssembly for now
394+
return Ok(());
395+
}
396+
#[cfg(not(target_arch = "wasm32"))]
397+
{
398+
let exception_group = import::import_frozen(self, "_py_exceptiongroup")?;
399+
let base_exception_group =
400+
exception_group.get_attr("BaseExceptionGroup", self)?;
401+
self.builtins
402+
.set_attr("BaseExceptionGroup", base_exception_group, self)?;
403+
let exception_group = exception_group.get_attr("ExceptionGroup", self)?;
404+
self.builtins
405+
.set_attr("ExceptionGroup", exception_group, self)?;
406+
Ok(())
407+
}
399408
};
400409
self.expect_pyresult(py_core_init(), "exceptiongroup initialization failed");
401410
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.