Skip to content

Commit f049ac2

Browse files
Add a WASM constant for Emscripten platform checks
1 parent bbc8868 commit f049ac2

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

pandas/compat/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
PY311,
2222
PY312,
2323
PYPY,
24+
WASM,
2425
)
2526
import pandas.compat.compressors
2627
from pandas.compat.numpy import is_numpy_dev
@@ -192,4 +193,5 @@ def get_bz2_file() -> type[pandas.compat.compressors.BZ2File]:
192193
"PY311",
193194
"PY312",
194195
"PYPY",
196+
"WASM",
195197
]

pandas/compat/_constants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
PY311 = sys.version_info >= (3, 11)
1818
PY312 = sys.version_info >= (3, 12)
1919
PYPY = platform.python_implementation() == "PyPy"
20+
WASM = (sys.platform == "emscripten") or (platform.machine() in ["wasm32", "wasm64"])
2021
ISMUSL = "musl" in (sysconfig.get_config_var("HOST_GNU_TYPE") or "")
2122
REF_COUNT = 2 if PY311 else 3
2223

@@ -27,4 +28,5 @@
2728
"PY311",
2829
"PY312",
2930
"PYPY",
31+
"WASM",
3032
]

0 commit comments

Comments
 (0)