From 3c19ee0422e9b9f1582fb74931c174a84583bca0 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Fri, 12 Jan 2024 15:19:21 -0800 Subject: [PATCH] GH-111801: set a lower recursion limit for `test_infintely_many_bases()` in `test_isinstance` (#113997) --- Lib/test/test_isinstance.py | 2 +- .../next/Tests/2024-01-12-13-19-12.gh-issue-111801.9hh9DY.rst | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Tests/2024-01-12-13-19-12.gh-issue-111801.9hh9DY.rst diff --git a/Lib/test/test_isinstance.py b/Lib/test/test_isinstance.py index bf9332e40aeaf2..791981b878b1f2 100644 --- a/Lib/test/test_isinstance.py +++ b/Lib/test/test_isinstance.py @@ -344,7 +344,7 @@ class B: pass A.__getattr__ = B.__getattr__ = X.__getattr__ return (A(), B()) - with support.infinite_recursion(): + with support.infinite_recursion(25): self.assertRaises(RecursionError, issubclass, X(), int) diff --git a/Misc/NEWS.d/next/Tests/2024-01-12-13-19-12.gh-issue-111801.9hh9DY.rst b/Misc/NEWS.d/next/Tests/2024-01-12-13-19-12.gh-issue-111801.9hh9DY.rst new file mode 100644 index 00000000000000..660fddd4a93038 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2024-01-12-13-19-12.gh-issue-111801.9hh9DY.rst @@ -0,0 +1,3 @@ +Lower the recursion limit in ``test_isinstance`` for +``test_infinitely_many_bases()``. This prevents a stack overflow on a +pydebug build of WASI.