diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-11-01 19:13:54 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-11-01 19:13:54 (GMT) |
commit | e4ad37e50efadc319d6c1089222f552dfcbf76ee (patch) | |
tree | b64936a5fbbdd7b21553261ebebd3ad09bf721ce /Lib | |
parent | 9f69e79c450c3c17172046f937941e6df1802a6d (diff) | |
download | cpython-e4ad37e50efadc319d6c1089222f552dfcbf76ee.zip cpython-e4ad37e50efadc319d6c1089222f552dfcbf76ee.tar.gz cpython-e4ad37e50efadc319d6c1089222f552dfcbf76ee.tar.bz2 |
Issue #16230: Fix a crash in select.select() when one the lists changes size while iterated on.
Patch by Serhiy Storchaka.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_select.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_select.py b/Lib/test/test_select.py index fe92f45..4ddc217 100644 --- a/Lib/test/test_select.py +++ b/Lib/test/test_select.py @@ -49,6 +49,16 @@ class SelectTestCase(unittest.TestCase): self.fail('Unexpected return values from select():', rfd, wfd, xfd) p.close() + # Issue 16230: Crash on select resized list + def test_select_mutated(self): + a = [] + class F: + def fileno(self): + del a[-1] + return sys.__stdout__.fileno() + a[:] = [F()] * 10 + self.assertEqual(select.select([], a, []), ([], a[:5], [])) + def test_main(): support.run_unittest(SelectTestCase) support.reap_children() |