mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
bpo-33106: change dbm key deletion error for readonly file from KeyError to dbm.error (#6295)
This commit is contained in:
parent
5a718e918d
commit
4fb0b8bc25
9 changed files with 57 additions and 9 deletions
|
@ -82,10 +82,10 @@ class DumbDBMTestCase(unittest.TestCase):
|
|||
self.init_db()
|
||||
f = dumbdbm.open(_fname, 'r')
|
||||
self.read_helper(f)
|
||||
with self.assertRaisesRegex(ValueError,
|
||||
with self.assertRaisesRegex(dumbdbm.error,
|
||||
'The database is opened for reading only'):
|
||||
f[b'g'] = b'x'
|
||||
with self.assertRaisesRegex(ValueError,
|
||||
with self.assertRaisesRegex(dumbdbm.error,
|
||||
'The database is opened for reading only'):
|
||||
del f[b'a']
|
||||
# get() works as in the dict interface
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue