Project

General

Profile

« Previous | Next » 

Revision 3028

xml_func.py: process(): Call list() on the items' iterator so that its length can be determined wherever it's used without needing to call list() on it separately

View differences:

lib/xml_func.py
93 93
    
94 94
    row_mode = has_rel_funcs and db != None
95 95
    column_mode = has_rel_funcs and db == None
96
    items = xml_dom.NodeTextEntryIter(node)
96
    items = list(xml_dom.NodeTextEntryIter(node))
97 97
    
98 98
    if row_mode and name in rel_funcs: # row-based mode: evaluate using DB
99 99
        value = sql.put(db, name, dict(items))
100 100
    elif column_mode and not name in structural_funcs: # column-based mode
101 101
        if name in rel_funcs: return # preserve relational functions
102 102
        # otherwise XML-only, so just replace with last param
103
        value = pop_value(list(items), None)
103
        value = pop_value(items, None)
104 104
    else: # local XML function
105 105
        try: value = funcs[name](items, node)
106 106
        except Exception, e: # also catch non-wrapped exceptions (XML func bugs)

Also available in: Unified diff