mirror of
https://github.com/python/cpython.git
synced 2025-09-27 10:50:04 +00:00
Make dumbdbm use bytes for keys consistently.
This commit is contained in:
parent
bb839ef8ac
commit
7b4beea02e
2 changed files with 8 additions and 4 deletions
|
@ -200,7 +200,11 @@ class _Database(UserDict.DictMixin):
|
|||
self._commit()
|
||||
|
||||
def keys(self):
|
||||
return self._index.keys()
|
||||
return [key.encode("latin-1") for key in self._index.keys()]
|
||||
|
||||
def items(self):
|
||||
return [(key.encode("latin-1"), self[key.encode("latin-1")])
|
||||
for key in self._index.keys()]
|
||||
|
||||
def __contains__(self, key):
|
||||
key = key.decode("latin-1")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue