From: Zac Medico Date: Thu, 3 Feb 2011 07:12:24 +0000 (-0800) Subject: bintree: clean up dict use in old binhost code X-Git-Tag: v2.2.0_alpha20~21 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=76c386bea08a5d75cfc431fffe64e842aeff5fa9;p=portage.git bintree: clean up dict use in old binhost code --- diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py index 4857e7fbf..6e58608a3 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: