diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-05-13 18:48:01 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-05-13 18:48:01 (GMT) |
commit | 9a2349030a706433b519ae99816fc540ecefc143 (patch) | |
tree | 8afad14bc8fa10812c97a35ef4fc1ab09521ee43 /Lib/test/test_dict.py | |
parent | 7feb9f42258ff72ce1d3628c5ccc261c2ca238b9 (diff) | |
download | cpython-9a2349030a706433b519ae99816fc540ecefc143.zip cpython-9a2349030a706433b519ae99816fc540ecefc143.tar.gz cpython-9a2349030a706433b519ae99816fc540ecefc143.tar.bz2 |
Issue #14417: Mutating a dict during lookup now restarts the lookup instead of raising a RuntimeError (undoes issue #14205).
Diffstat (limited to 'Lib/test/test_dict.py')
-rw-r--r-- | Lib/test/test_dict.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/test/test_dict.py b/Lib/test/test_dict.py index 426f76e..dd4d552 100644 --- a/Lib/test/test_dict.py +++ b/Lib/test/test_dict.py @@ -411,7 +411,7 @@ class DictTest(unittest.TestCase): d[i+1] = 1 def test_mutating_lookup(self): - # changing dict during a lookup + # changing dict during a lookup (issue #14417) class NastyKey: mutate_dict = None @@ -433,9 +433,8 @@ class DictTest(unittest.TestCase): key2 = NastyKey(2) d = {key1: 1} NastyKey.mutate_dict = (d, key1) - with self.assertRaisesRegex(RuntimeError, - 'dictionary changed size during lookup'): - d[key2] = 2 + d[key2] = 2 + self.assertEqual(d, {key2: 2}) def test_repr(self): d = {} |