Skip to content

Commit 0a2d3ef

Browse files
Add a reusable check for WASM platfoms
1 parent 5eb6c1c commit 0a2d3ef

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

zarr/tests/util.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import collections
22
import os
3+
import sys
4+
import platform
35
import tempfile
46
from typing import Any, Mapping, Sequence
57
from zarr.context import Context
@@ -118,3 +120,7 @@ def mktemp(**kwargs):
118120
f = tempfile.NamedTemporaryFile(**kwargs)
119121
f.close()
120122
return f.name
123+
124+
125+
def is_wasm():
126+
return (sys.platform == "emscripten" or platform.machine() in ["wasm32", "wasm64"])

0 commit comments

Comments
 (0)