From: Arfrever Frehtes Taifersar Arahesis Date: Fri, 25 Sep 2009 05:56:25 +0000 (-0000) Subject: Use 'in' instead of has_key() in portage.glsa.Glsa.parse() when Python 3 is used. X-Git-Tag: v2.2_rc42~11 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1dd031f0a5457b9b53c7a3027b29cea9278f81ec;p=portage.git Use 'in' instead of has_key() in portage.glsa.Glsa.parse() when Python 3 is used. svn path=/main/trunk/; revision=14422 --- diff --git a/pym/portage/glsa.py b/pym/portage/glsa.py index 4049efc2d..4684ea420 100644 --- a/pym/portage/glsa.py +++ b/pym/portage/glsa.py @@ -511,7 +511,8 @@ class Glsa: # 2007-12-30 revisedEl = myroot.getElementsByTagName("revised")[0] self.revised = getText(revisedEl, format="strip") - if (revisedEl.attributes.has_key("count")): + if ((sys.hexversion >= 0x3000000 and "count" in revisedEl.attributes) or + (sys.hexversion < 0x3000000 and revisedEl.attributes.has_key("count"))): count = revisedEl.getAttribute("count") elif (self.revised.find(":") >= 0): (self.revised, count) = self.revised.split(":")