We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d279067 commit bf01d4cCopy full SHA for bf01d4c
1 file changed
Lib/test/test_structseq.py
@@ -1,4 +1,5 @@
1
import copy
2
+import gc
3
import os
4
import pickle
5
import re
@@ -355,6 +356,14 @@ def test_reference_cycle(self):
355
356
type(t).refcyle = t
357
"""))
358
359
+ def test_replace_gc_tracked(self):
360
+ # Verify that __replace__ results are properly GC-tracked
361
+ time_struct= time.gmtime(0)
362
+ lst = []
363
+ replaced_struct = time_struct.__replace__(tm_year=lst)
364
+ lst.append(replaced_struct)
365
+
366
+ self.assertTrue(gc.is_tracked(replaced_struct))
367
368
if __name__ == "__main__":
369
unittest.main()
0 commit comments