mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Patch #103854: raises an exception if a non-Attr node is passed to
NamedNodeMap.setNamedItem(). Martin, should I sync the PyXML tree, too, or do you want to do it? (I don't know if you're wrapping the 0.6.4 release right now.)
This commit is contained in:
parent
8b94b1c74a
commit
bc8f72cccc
2 changed files with 14 additions and 0 deletions
|
|
@ -98,6 +98,17 @@ def testLegalChildren():
|
|||
else:
|
||||
print "dom.appendChild didn't raise HierarchyRequestErr"
|
||||
|
||||
nodemap = elem.attributes
|
||||
try: nodemap.setNamedItem(text)
|
||||
except HierarchyRequestErr: pass
|
||||
else:
|
||||
print "NamedNodeMap.setNamedItem didn't raise HierarchyRequestErr"
|
||||
|
||||
try: nodemap.setNamedItemNS(text)
|
||||
except HierarchyRequestErr: pass
|
||||
else:
|
||||
print "NamedNodeMap.setNamedItemNS didn't raise HierarchyRequestErr"
|
||||
|
||||
elem.appendChild(text)
|
||||
dom.unlink()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue