diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-10-04 17:53:29 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-10-04 17:53:29 (GMT) |
commit | ee329318db90d59a81b8d69a2ad8e32c0aa59cd9 (patch) | |
tree | 04fa62ef1d45d8f2533bd3f752b7e75e4f5a1910 /Lib/xml | |
parent | 3934b61a1606161e38d53628a8dc7bde19d8767b (diff) | |
download | cpython-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')
-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 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__) ## |