commit:     90e142b8fccba0507687b747478c5e060effcb00
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jun  2 15:46:41 2016 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jun  2 15:47:49 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=90e142b8

binarytree._populate: suppress PORTAGE_SSH_OPTS KeyError (bug 572494)

Use the "get" method to avoid triggering a KeyError message.

Fixes: 39d81c514c33 ("[...]config.__getitem__(): Partially drop backward 
compatibility for nonexistent keys.")
X-Gentoo-Bug: 572494
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=572494

 pym/portage/dbapi/bintree.py | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py
index dc18d30..f483059 100644
--- a/pym/portage/dbapi/bintree.py
+++ b/pym/portage/dbapi/bintree.py
@@ -905,10 +905,9 @@ class binarytree(object):
                                                }
 
                                                for k in ("PORTAGE_SSH_OPTS",):
-                                                       try:
-                                                               fcmd_vars[k] = 
self.settings[k]
-                                                       except KeyError:
-                                                               pass
+                                                       v = self.settings.get(k)
+                                                       if v is not None:
+                                                               fcmd_vars[k] = v
 
                                                success = 
portage.getbinpkg.file_get(
                                                        fcmd=fcmd, 
fcmd_vars=fcmd_vars)

Reply via email to