bpo-33106: change dbm key deletion error for readonly file from KeyError to dbm.error (#6295)

This commit is contained in:
Xiang Zhang 2018-12-12 20:46:55 +08:00 committed by GitHub
parent 5a718e918d
commit 4fb0b8bc25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 57 additions and 9 deletions

View file

@ -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