From 3df0e63aabef905b72fad78256f24b9270c63172 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Sun, 3 Apr 2022 00:11:38 +0300 Subject: [PATCH] bpo-46315: Use fopencookie only on Emscripten 3.x and newer (GH-32266) --- Parser/tokenizer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c index 13116d052ea..db84e2e92e1 100644 --- a/Parser/tokenizer.c +++ b/Parser/tokenizer.c @@ -2072,7 +2072,7 @@ _PyTokenizer_Get(struct tok_state *tok, return result; } -#if defined(__wasi__) || defined(__EMSCRIPTEN__) +#if defined(__wasi__) || (defined(__EMSCRIPTEN__) && (__EMSCRIPTEN_major__ >= 3)) // fdopen() with borrowed fd. WASI does not provide dup() and Emscripten's // dup() emulation with open() is slow. typedef union {