summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2022-05-19 10:43:16 (GMT)
committerGitHub <noreply@github.com>2022-05-19 10:43:16 (GMT)
commit137fd3d88aa46669f5717734e823f4c594ab2843 (patch)
treea527865e1f3729ef3d7c69a43d08072d8d837d9c /Include
parente48ac9c1003c3816198cbfb6132a995150f9b048 (diff)
downloadcpython-137fd3d88aa46669f5717734e823f4c594ab2843.zip
cpython-137fd3d88aa46669f5717734e823f4c594ab2843.tar.gz
cpython-137fd3d88aa46669f5717734e823f4c594ab2843.tar.bz2
gh-90473: Decrease recursion limit and skip tests on WASI (GH-92803)
Diffstat (limited to 'Include')
-rw-r--r--Include/internal/pycore_ceval.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/Include/internal/pycore_ceval.h b/Include/internal/pycore_ceval.h
index 8dd89c6..3efd6be 100644
--- a/Include/internal/pycore_ceval.h
+++ b/Include/internal/pycore_ceval.h
@@ -12,8 +12,14 @@ extern "C" {
struct pyruntimestate;
struct _ceval_runtime_state;
+/* WASI has limited call stack. wasmtime 0.36 can handle sufficient amount of
+ C stack frames for little more than 750 recursions. */
#ifndef Py_DEFAULT_RECURSION_LIMIT
-# define Py_DEFAULT_RECURSION_LIMIT 1000
+# ifdef __wasi__
+# define Py_DEFAULT_RECURSION_LIMIT 750
+# else
+# define Py_DEFAULT_RECURSION_LIMIT 1000
+# endif
#endif
#include "pycore_interp.h" // PyInterpreterState.eval_frame