mirror of
https://github.com/python/cpython.git
synced 2026-01-06 23:42:34 +00:00
[3.13] gh-130957: Use sleeping_retry in test_free_reference (GH-130958) (#131091)
The weak reference may not be immediately dead.
(cherry picked from commit 1908115871)
Co-authored-by: Sam Gross <colesbury@gmail.com>
This commit is contained in:
parent
a49f85a694
commit
98c7ae3f7e
1 changed files with 4 additions and 1 deletions
|
|
@ -128,4 +128,7 @@ def test_free_reference(self):
|
|||
wr = weakref.ref(obj)
|
||||
del obj
|
||||
support.gc_collect() # For PyPy or other GCs.
|
||||
self.assertIsNone(wr())
|
||||
|
||||
for _ in support.sleeping_retry(support.SHORT_TIMEOUT):
|
||||
if wr() is None:
|
||||
break
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue