Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/dbapi/
Date: Thu, 02 Jun 2016 15:48:15
Message-Id: 1464882469.90e142b8fccba0507687b747478c5e060effcb00.zmedico@gentoo
1 commit: 90e142b8fccba0507687b747478c5e060effcb00
2 Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jun 2 15:46:41 2016 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Thu Jun 2 15:47:49 2016 +0000
6 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=90e142b8
7
8 binarytree._populate: suppress PORTAGE_SSH_OPTS KeyError (bug 572494)
9
10 Use the "get" method to avoid triggering a KeyError message.
11
12 Fixes: 39d81c514c33 ("[...]config.__getitem__(): Partially drop backward compatibility for nonexistent keys.")
13 X-Gentoo-Bug: 572494
14 X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=572494
15
16 pym/portage/dbapi/bintree.py | 7 +++----
17 1 file changed, 3 insertions(+), 4 deletions(-)
18
19 diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py
20 index dc18d30..f483059 100644
21 --- a/pym/portage/dbapi/bintree.py
22 +++ b/pym/portage/dbapi/bintree.py
23 @@ -905,10 +905,9 @@ class binarytree(object):
24 }
25
26 for k in ("PORTAGE_SSH_OPTS",):
27 - try:
28 - fcmd_vars[k] = self.settings[k]
29 - except KeyError:
30 - pass
31 + v = self.settings.get(k)
32 + if v is not None:
33 + fcmd_vars[k] = v
34
35 success = portage.getbinpkg.file_get(
36 fcmd=fcmd, fcmd_vars=fcmd_vars)