diff options
author | Chris Larson <chris_larson@mentor.com> | 2011-04-04 09:36:10 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-05-06 15:49:17 +0100 |
commit | 7fc020aa15d918b215575576d91160afae7f4d70 (patch) | |
tree | ed9b029c8b2dfd355396de9183517e852333612b /bitbake/lib/bb/persist_data.py | |
parent | fc801b907361cfdb7e329eefac7a0c991e86c736 (diff) | |
download | poky-7fc020aa15d918b215575576d91160afae7f4d70.tar.gz |
persist_data: raise KeyError on missing elements
(Bitbake rev: a4f62433845c29f98c6a9746d5d2847bf9506ea5)
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/persist_data.py')
-rw-r--r-- | bitbake/lib/bb/persist_data.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/bitbake/lib/bb/persist_data.py b/bitbake/lib/bb/persist_data.py index f51a42efd2..eae64cf792 100644 --- a/bitbake/lib/bb/persist_data.py +++ b/bitbake/lib/bb/persist_data.py | |||
@@ -69,8 +69,11 @@ class SQLTable(collections.MutableMapping): | |||
69 | self.table, [key]) | 69 | self.table, [key]) |
70 | for row in data: | 70 | for row in data: |
71 | return row[1] | 71 | return row[1] |
72 | raise KeyError(key) | ||
72 | 73 | ||
73 | def __delitem__(self, key): | 74 | def __delitem__(self, key): |
75 | if key not in self: | ||
76 | raise KeyError(key) | ||
74 | self._execute("DELETE from %s where key=?;" % self.table, [key]) | 77 | self._execute("DELETE from %s where key=?;" % self.table, [key]) |
75 | 78 | ||
76 | def __setitem__(self, key, value): | 79 | def __setitem__(self, key, value): |