changeset 370:fa5400c2879d

Fix for report imports; I would have thought that the original child.attr would work since it's a DictMixin, but at runtime, we're seeing 'argument after ** must be a dictionary'
author wbell
date Mon, 23 Jul 2007 21:42:50 +0000
parents 7c3ecdd84e7c
children 71f7d5e13b11
files bitten/recipe.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/bitten/recipe.py
+++ b/bitten/recipe.py
@@ -127,7 +127,8 @@
             try:
                 xml_elem = xmlio.Fragment()
                 for child in xmlio.parse(fileobj).children():
-                    xml_elem.append(xmlio.Element(child.name, **child.attr)[
+		    child_elem = xmlio.Element(child.name, **dict([(name, value) for name, value in child.attr.items() if value is not None]))	
+                    xml_elem.append(child_elem[
                         [xmlio.Element(grandchild.name)[grandchild.gettext()]
                         for grandchild in child.children()]
                     ])
Copyright (C) 2012-2017 Edgewall Software