From 2dd4432228b679e166ed7edaad91f938acba29e4 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 2 Feb 2011 23:12:24 -0800 Subject: [PATCH] bintree: clean up dict use in old binhost code --- pym/portage/dbapi/bintree.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py index 522967a72..33482a1d3 100644 --- a/pym/portage/dbapi/bintree.py +++ b/pym/portage/dbapi/bintree.py @@ -912,13 +912,14 @@ class binarytree(object): base_url, chunk_size=chunk_size) for mypkg, remote_metadata in list(remotepkgs.items()): - if "CATEGORY" not in remote_metadata: + mycat = remote_metadata.get("CATEGORY") + if mycat is None: #old-style or corrupt package writemsg(_("!!! Invalid remote binary package: %s\n") % mypkg, noiselevel=-1) del remotepkgs[mypkg] continue - mycat = remotepkgs[mypkg]["CATEGORY"].strip() + mycat = mycat.strip() fullpkg = mycat+"/"+mypkg[:-5] if fullpkg in metadata: -- 2.26.2