Use 'in' instead of has_key() in portage.glsa.Glsa.parse() when Python 3 is used.
authorArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>
Fri, 25 Sep 2009 05:56:25 +0000 (05:56 -0000)
committerArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>
Fri, 25 Sep 2009 05:56:25 +0000 (05:56 -0000)
svn path=/main/trunk/; revision=14422

pym/portage/glsa.py

index 4049efc2d7e6f18b6daafb4fdf6677c3bd744a81..4684ea420a77a887f7dbf66813d0f2f2707cc1bd 100644 (file)
@@ -511,7 +511,8 @@ class Glsa:
                # <revised count="2">2007-12-30</revised>
                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(":")