summaryrefslogtreecommitdiffstats
path: root/Lib/xml/etree
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2012-10-04 17:53:29 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2012-10-04 17:53:29 (GMT)
commitee329318db90d59a81b8d69a2ad8e32c0aa59cd9 (patch)
tree04fa62ef1d45d8f2533bd3f752b7e75e4f5a1910 /Lib/xml/etree
parent3934b61a1606161e38d53628a8dc7bde19d8767b (diff)
downloadcpython-ee329318db90d59a81b8d69a2ad8e32c0aa59cd9.zip
cpython-ee329318db90d59a81b8d69a2ad8e32c0aa59cd9.tar.gz
cpython-ee329318db90d59a81b8d69a2ad8e32c0aa59cd9.tar.bz2
Issue #16089: Allow ElementTree.TreeBuilder to work again with a non-Element element_factory (fixes a regression in SimpleTAL).
Diffstat (limited to 'Lib/xml/etree')
-rw-r--r--Lib/xml/etree/ElementTree.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/xml/etree/ElementTree.py b/Lib/xml/etree/ElementTree.py
index b9d8df6..9553c51 100644
--- a/Lib/xml/etree/ElementTree.py
+++ b/Lib/xml/etree/ElementTree.py
@@ -303,7 +303,9 @@ class Element:
self._children.insert(index, element)
def _assert_is_element(self, e):
- if not isinstance(e, Element):
+ # Need to refer to the actual Python implementation, not the
+ # shadowing C implementation.
+ if not isinstance(e, _Element):
raise TypeError('expected an Element, not %s' % type(e).__name__)
##