summaryrefslogtreecommitdiffstats
path: root/utils_xml.py
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2015-03-04 16:59:22 +0100
committerJan Pokorný <jpokorny@redhat.com>2015-03-04 17:20:30 +0100
commite771923d16b35431d1756b8639d3bc71d4242378 (patch)
tree1a1a69fae387a14ea051a7e2a730b6e3f77604c3 /utils_xml.py
parenta37255eaefb7d0fc401f17b4a876bdf18856bcbc (diff)
downloadclufter-e771923d16b35431d1756b8639d3bc71d4242378.tar.gz
clufter-e771923d16b35431d1756b8639d3bc71d4242378.tar.xz
clufter-e771923d16b35431d1756b8639d3bc71d4242378.zip
utils_xml: skip extending with None nonstring arg in nselem
Related to "script" RA ccs2pcs conversion provided by Patrik Hagara. Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Diffstat (limited to 'utils_xml.py')
-rw-r--r--utils_xml.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/utils_xml.py b/utils_xml.py
index e31c1be..f835dae 100644
--- a/utils_xml.py
+++ b/utils_xml.py
@@ -1,5 +1,5 @@
# -*- coding: UTF-8 -*-
-# Copyright 2014 Red Hat, Inc.
+# Copyright 2015 Red Hat, Inc.
# Part of clufter project
# Licensed under GPLv2+ (a copy included | http://gnu.org/licenses/gpl-2.0.txt)
"""XML helpers"""
@@ -42,7 +42,7 @@ def namespaced(ns, ident):
def nselem(ns, tag, *args, **kwargs):
ret = etree.Element(namespaced(ns, tag), **kwargs)
strings, nonstrings = bifilter(lambda x: isinstance(x, basestring), args)
- ret.extend(nonstrings)
+ ret.extend(ns for ns in nonstrings if ns is not None)
# conditionally assigned so as to support self-closed tags where possible
text = ' '.join(strings)
if text: