summaryrefslogtreecommitdiffstats
path: root/Lib/xml/etree/ElementTree.py
diff options
context:
space:
mode:
authorEli Bendersky <eliben@gmail.com>2012-05-29 03:02:56 (GMT)
committerEli Bendersky <eliben@gmail.com>2012-05-29 03:02:56 (GMT)
commit737b173355b0473d134b1715dd8b1695eb023d8b (patch)
tree5921978a2a92a9298c2b01f93de7a94e6ee0d25a /Lib/xml/etree/ElementTree.py
parent6bed342b5895c816ac8d731d780ca6f01f8ea875 (diff)
downloadcpython-737b173355b0473d134b1715dd8b1695eb023d8b.zip
cpython-737b173355b0473d134b1715dd8b1695eb023d8b.tar.gz
cpython-737b173355b0473d134b1715dd8b1695eb023d8b.tar.bz2
Issue 14814: Add namespaces keyword arg to find(*) methods in _elementtree.
Add attrib keyword to Element and SubElement in _elementtree. Patch developed with Ezio Melotti.
Diffstat (limited to 'Lib/xml/etree/ElementTree.py')
-rw-r--r--Lib/xml/etree/ElementTree.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/xml/etree/ElementTree.py b/Lib/xml/etree/ElementTree.py
index 5f974f6..e068fc2 100644
--- a/Lib/xml/etree/ElementTree.py
+++ b/Lib/xml/etree/ElementTree.py
@@ -205,6 +205,9 @@ class Element:
# constructor
def __init__(self, tag, attrib={}, **extra):
+ if not isinstance(attrib, dict):
+ raise TypeError("attrib must be dict, not %s" % (
+ attrib.__class__.__name__,))
attrib = attrib.copy()
attrib.update(extra)
self.tag = tag