]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-110178: Use fewer weakrefs in test_typing.py (GH-110194) (#110224)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 2 Oct 2023 17:15:30 +0000 (10:15 -0700)
committerGitHub <noreply@github.com>
Mon, 2 Oct 2023 17:15:30 +0000 (18:15 +0100)
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 <jelle.zijlstra@gmail.com>
Lib/test/test_typing.py

index eb7617737b8c1d0818afd86fbf7bbcd53896b26a..83f25402d8793bb7819f118081eeb67e568d3152 100644 (file)
@@ -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