summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Include/cpython/pystate.h2
-rw-r--r--Lib/test/test_functools.py6
2 files changed, 6 insertions, 2 deletions
diff --git a/Include/cpython/pystate.h b/Include/cpython/pystate.h
index f1540fd..7fb6b17 100644
--- a/Include/cpython/pystate.h
+++ b/Include/cpython/pystate.h
@@ -209,6 +209,8 @@ struct _ts {
# define Py_C_RECURSION_LIMIT 500
#elif defined(__s390x__)
# define Py_C_RECURSION_LIMIT 800
+#elif defined(_WIN32) && defined(_M_ARM64)
+# define Py_C_RECURSION_LIMIT 1000
#elif defined(_WIN32)
# define Py_C_RECURSION_LIMIT 3000
#elif defined(__ANDROID__)
diff --git a/Lib/test/test_functools.py b/Lib/test/test_functools.py
index 1a6d8af..3ba4929 100644
--- a/Lib/test/test_functools.py
+++ b/Lib/test/test_functools.py
@@ -334,8 +334,10 @@ class TestPartial:
f.__setstate__((f, (), {}, {}))
try:
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
- with self.assertRaises(RecursionError):
- pickle.dumps(f, proto)
+ # gh-117008: Small limit since pickle uses C stack memory
+ with support.infinite_recursion(100):
+ with self.assertRaises(RecursionError):
+ pickle.dumps(f, proto)
finally:
f.__setstate__((capture, (), {}, {}))