From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Mon, 2 Oct 2023 17:15:30 +0000 (-0700) Subject: [3.12] gh-110178: Use fewer weakrefs in test_typing.py (GH-110194) (#110224) X-Git-Tag: v3.12.1~405 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=46e69576a96e200ed8e6c94c43864b3dc17f30a6;p=thirdparty%2FPython%2Fcpython.git [3.12] gh-110178: Use fewer weakrefs in test_typing.py (GH-110194) (#110224) gh-110178: Use fewer weakrefs in test_typing.py (GH-110194) Confirmed that without the C changes from GH-108517, this test still segfaults with only 10 weakrefs. (cherry picked from commit 732ad44cec971be5255b1accbac6555d3615c2bf) Co-authored-by: Jelle Zijlstra --- diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index eb7617737b8c..83f25402d879 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -550,7 +550,7 @@ class TypeVarTests(BaseTestCase): with self.subTest(cls=cls): vals = weakref.WeakValueDictionary() - for x in range(100000): + for x in range(10): vals[x] = cls(str(x)) del vals