mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Make gdbm and dumbdbm use byte strings. Updated their tests.
This commit is contained in:
parent
517bcfeb6b
commit
6252e10ed9
7 changed files with 68 additions and 61 deletions
|
|
@ -21,13 +21,13 @@ def _delete_files():
|
|||
pass
|
||||
|
||||
class AnyDBMTestCase(unittest.TestCase):
|
||||
_dict = {'0': '',
|
||||
'a': 'Python:',
|
||||
'b': 'Programming',
|
||||
'c': 'the',
|
||||
'd': 'way',
|
||||
'f': 'Guido',
|
||||
'g': 'intended'
|
||||
_dict = {'0': b'',
|
||||
'a': b'Python:',
|
||||
'b': b'Programming',
|
||||
'c': b'the',
|
||||
'd': b'way',
|
||||
'f': b'Guido',
|
||||
'g': b'intended',
|
||||
}
|
||||
|
||||
def __init__(self, *args):
|
||||
|
|
@ -44,7 +44,7 @@ class AnyDBMTestCase(unittest.TestCase):
|
|||
def test_anydbm_modification(self):
|
||||
self.init_db()
|
||||
f = anydbm.open(_fname, 'c')
|
||||
self._dict['g'] = f['g'] = "indented"
|
||||
self._dict['g'] = f['g'] = b"indented"
|
||||
self.read_helper(f)
|
||||
f.close()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue