Browse Source
bpo-43399: Fix ElementTree.extend not working on iterators (GH-24751)
pull/25124/head
Alex Prengère
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
7 additions and
1 deletions
-
Lib/test/test_xml_etree.py
-
Lib/xml/etree/ElementTree.py
-
Misc/ACKS
-
Misc/NEWS.d/next/Library/2021-03-04-17-53-46.bpo-43399.Wn95u-.rst
|
|
|
@ -330,6 +330,9 @@ class ElementTreeTest(unittest.TestCase): |
|
|
|
elem.extend([e]) |
|
|
|
self.serialize_check(elem, '<body><tag /><tag2 /></body>') |
|
|
|
elem.remove(e) |
|
|
|
elem.extend(iter([e])) |
|
|
|
self.serialize_check(elem, '<body><tag /><tag2 /></body>') |
|
|
|
elem.remove(e) |
|
|
|
|
|
|
|
element = ET.Element("tag", key="value") |
|
|
|
self.serialize_check(element, '<tag key="value" />') # 1 |
|
|
|
|
|
|
|
@ -252,7 +252,7 @@ class Element: |
|
|
|
""" |
|
|
|
for element in elements: |
|
|
|
self._assert_is_element(element) |
|
|
|
self._children.extend(elements) |
|
|
|
self._children.append(element) |
|
|
|
|
|
|
|
def insert(self, index, subelement): |
|
|
|
"""Insert *subelement* at position *index*.""" |
|
|
|
|
|
|
|
@ -1381,6 +1381,7 @@ Matheus Vieira Portela |
|
|
|
Davin Potts |
|
|
|
Guillaume Pratte |
|
|
|
Florian Preinstorfer |
|
|
|
Alex Prengère |
|
|
|
Amrit Prem |
|
|
|
Paul Prescod |
|
|
|
Donovan Preston |
|
|
|
|
|
|
|
@ -0,0 +1,2 @@ |
|
|
|
Fix ``ElementTree.extend`` not working on iterators when using the |
|
|
|
Python implementation |