mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #16089: Allow ElementTree.TreeBuilder to work again with a non-Element element_factory (fixes a regression in SimpleTAL).
This commit is contained in:
parent
3934b61a16
commit
ee329318db
4 changed files with 127 additions and 31 deletions
|
@ -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__)
|
||||
|
||||
##
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue