Issue #7466: segmentation fault when the garbage collector is called

in the middle of populating a tuple.  Patch by Florent Xicluna.

(note: no NEWS entry for trunk since the bug was introduced in 2.7/3.1)
This commit is contained in:
Antoine Pitrou 2009-12-12 19:13:08 +00:00
parent 9be87bc992
commit c169c781a8
2 changed files with 5 additions and 1 deletions

View file

@ -146,6 +146,9 @@ class TupleTest(seq_tests.CommonTest):
pass
self.check_track_dynamic(MyTuple, True)
def test_bug7466(self):
# Trying to untrack an unfinished tuple could crash Python
self._not_tracked(tuple(gc.collect() for i in range(101)))
def test_main():
test_support.run_unittest(TupleTest)