1 |
commit: 9073762274c112f3d080367ea0fb24edb88564be |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Sep 24 20:25:46 2015 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Sep 24 20:30:06 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=90737622 |
7 |
|
8 |
fakedbapi.cpv_exists: handle KeyError from _instance_key |
9 |
|
10 |
Since commit 7921e61065502fd0bb08d9dfef6a4493657961bf, cpv_exists |
11 |
needs to handle KeyError from _instance_key_multi_instance. |
12 |
|
13 |
Fixes: 7921e6106550 ("binpkg-multi-instance 2 of 7") |
14 |
|
15 |
pym/portage/dbapi/virtual.py | 8 ++++++-- |
16 |
1 file changed, 6 insertions(+), 2 deletions(-) |
17 |
|
18 |
diff --git a/pym/portage/dbapi/virtual.py b/pym/portage/dbapi/virtual.py |
19 |
index a59c3b5..f2e841f 100644 |
20 |
--- a/pym/portage/dbapi/virtual.py |
21 |
+++ b/pym/portage/dbapi/virtual.py |
22 |
@@ -98,8 +98,12 @@ class fakedbapi(dbapi): |
23 |
return result[:] |
24 |
|
25 |
def cpv_exists(self, mycpv, myrepo=None): |
26 |
- return self._instance_key(mycpv, |
27 |
- support_string=True) in self.cpvdict |
28 |
+ try: |
29 |
+ return self._instance_key(mycpv, |
30 |
+ support_string=True) in self.cpvdict |
31 |
+ except KeyError: |
32 |
+ # _instance_key failure |
33 |
+ return False |
34 |
|
35 |
def cp_list(self, mycp, use_cache=1, myrepo=None): |
36 |
# NOTE: Cache can be safely shared with the match cache, since the |