diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-10-04 17:54:53 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-10-04 17:54:53 (GMT) |
commit | 997adb58191b63d9f12626a1e04770f496a0d9f3 (patch) | |
tree | 7f525bd4ef436fb61e2b52433ac9ea4145e333b0 /Lib/xml/etree | |
parent | df5959371f050ccb8e36eef12e3d9ac2f48b8c58 (diff) | |
parent | ee329318db90d59a81b8d69a2ad8e32c0aa59cd9 (diff) | |
download | cpython-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/etree')
-rw-r--r-- | Lib/xml/etree/ElementTree.py | 4 |
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__) ## |