data: support calling get() on a non-existent key, by returning None
This behavior isn't used at the moment, but is much more sensible that the past that was to give None to whatever content-type lambda we had (eg DefList that would call split on the None). Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
This commit is contained in:
parent
9cd1b140d2
commit
1f5f16d5b8
1 changed files with 1 additions and 2 deletions
|
|
@ -165,8 +165,7 @@ class BsdDB:
|
|||
def get(self, key):
|
||||
key = autoBytes(key)
|
||||
p = self.db.get(key)
|
||||
p = self.ctype(p)
|
||||
return p
|
||||
return self.ctype(p) if p is not None else None
|
||||
|
||||
def get_keys(self):
|
||||
return self.db.keys()
|
||||
|
|
|
|||
Loading…
Reference in a new issue