summaryrefslogtreecommitdiff
path: root/Lib/xml
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2012-10-04 19:54:53 +0200
committerAntoine Pitrou <solipsis@pitrou.net>2012-10-04 19:54:53 +0200
commitc6bce6aa07c6058e61dbccaeed045ef86ac3d27f (patch)
tree620ee563b17302f2c7bc56ea5f7e1341b3b3a892 /Lib/xml
parentbc71b52129c7ea8dc0d5a95f97504de9ccadd78a (diff)
parent91b8eeae560becdd8f1f135ead9ab6082ddf4ba4 (diff)
downloadcpython-c6bce6aa07c6058e61dbccaeed045ef86ac3d27f.tar.gz
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 c199b17eb1..ded894ddda 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__)
##