diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2024-02-14 17:17:58 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-14 17:17:58 (GMT) |
commit | d25894332aa363388ccc967980635a7fa650bbee (patch) | |
tree | 1bd11660fe89f033d1b7f63634014211a80c9097 /Lib/test | |
parent | 13af281a53bcf522f933afbbe6af4ed2da823943 (diff) | |
download | cpython-d25894332aa363388ccc967980635a7fa650bbee.zip cpython-d25894332aa363388ccc967980635a7fa650bbee.tar.gz cpython-d25894332aa363388ccc967980635a7fa650bbee.tar.bz2 |
[3.12] gh-115243: Fix crash in deque.index() when the deque is concurrently modified (GH-115247) (GH-115465)
(cherry picked from commit 671360161f0b7a5ff4c1d062e570962e851b4bde)
Co-authored-by: kcatss <kcats9731@gmail.com>
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_deque.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_deque.py b/Lib/test/test_deque.py index ae1dfac..4679f29 100644 --- a/Lib/test/test_deque.py +++ b/Lib/test/test_deque.py @@ -166,7 +166,7 @@ class TestBasic(unittest.TestCase): with self.assertRaises(RuntimeError): n in d - def test_contains_count_stop_crashes(self): + def test_contains_count_index_stop_crashes(self): class A: def __eq__(self, other): d.clear() @@ -178,6 +178,10 @@ class TestBasic(unittest.TestCase): with self.assertRaises(RuntimeError): _ = d.count(3) + d = deque([A()]) + with self.assertRaises(RuntimeError): + d.index(0) + def test_extend(self): d = deque('a') self.assertRaises(TypeError, d.extend, 1) |