8000 [3.9] bpo-43399: Fix ElementTree.extend not working on iterators (GH-24751) by miss-islington · Pull Request #25102 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

[3.9] bpo-43399: Fix ElementTree.extend not working on iterators (GH-24751) #25102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Lib/test/test_xml_etree.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,9 @@ def test_simpleops(self):
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
Expand Down
2 changes: 1 addition & 1 deletion Lib/xml/etree/ElementTree.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def extend(self, elements):
"""
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*."""
Expand Down
1 change: 1 addition & 0 deletions Misc/ACKS
Original file line number Diff line number Diff line change
Expand Up @@ -1363,6 +1363,7 @@ Matheus Vieira Portela
Davin Potts
Guillaume Pratte
Florian Preinstorfer
Alex Prengère
Amrit Prem
Paul Prescod
Donovan Preston
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix ``ElementTree.extend`` not working on iterators when using the
Python implementation
0