Project

General

Profile

« Previous | Next » 

Revision 2003

xpath.py: set_id(): When creating the id_path, use obj() (which deepcopy()s the entire path) because it prevents pointers w/o targets

View differences:

lib/xpath.py
94 94
    id_attr = XpathElem('id', None, is_attr=True)
95 95
    
96 96
    # Save the path to the ID attr
97
    id_path = path[:id_level] # the path before the ID level
98
    id_path.append(copy.deepcopy(id_elem)) # this path's id_elem is independent
97
    id_path = obj(path) # a copy of the path up through the ID level
99 98
    id_path.append(copy.copy(id_attr)) # this path's id_attr is independent
100 99
    
101 100
    # Set the ID attr on the provided XPath

Also available in: Unified diff