summaryrefslogtreecommitdiffstats
path: root/Lib/xml
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2012-10-04 17:54:53 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2012-10-04 17:54:53 (GMT)
commit997adb58191b63d9f12626a1e04770f496a0d9f3 (patch)
tree7f525bd4ef436fb61e2b52433ac9ea4145e333b0 /Lib/xml
parentdf5959371f050ccb8e36eef12e3d9ac2f48b8c58 (diff)
parentee329318db90d59a81b8d69a2ad8e32c0aa59cd9 (diff)
downloadcpython-997adb58191b63d9f12626a1e04770f496a0d9f3.zip
cpython-997adb58191b63d9f12626a1e04770f496a0d9f3.tar.gz
cpython-997adb58191b63d9f12626a1e04770f496a0d9f3.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')
-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 c199b17..ded894d 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__)
##