Bug #334265 - Fix AttributeError triggered by empty herd element in
authorZac Medico <zmedico@gentoo.org>
Tue, 24 Aug 2010 15:15:00 +0000 (08:15 -0700)
committerZac Medico <zmedico@gentoo.org>
Tue, 24 Aug 2010 15:15:00 +0000 (08:15 -0700)
check_metadata_herds().

pym/repoman/utilities.py

index 8e15de0838872f3bdfc886c75c29eac7743b8e99..9dd5cde3533a9c40da153014cef47deedc5d509d 100644 (file)
@@ -143,7 +143,7 @@ class UnknownHerdsError(ValueError):
 def check_metadata_herds(xml_tree, herd_base):
        herd_nodes = xml_tree.findall('herd')
        unknown_herds = [name for name in
-                       (e.text.strip() for e in herd_nodes)
+                       (e.text.strip() for e in herd_nodes if e.text is not None)
                        if not herd_base.known_herd(name)]
 
        if unknown_herds: