summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-01-31 11:59:58 (GMT)
committerGitHub <noreply@github.com>2024-01-31 11:59:58 (GMT)
commit5d7b90db0cd463e69d15acf5498232b9bc2bfeaa (patch)
tree8babd901e2d0acf9a32af1c4afd3b4603f2f0aec /Lib/test
parent0536bbb192c5ecca5e21385f82b0ac86f2e7e34c (diff)
downloadcpython-5d7b90db0cd463e69d15acf5498232b9bc2bfeaa.zip
cpython-5d7b90db0cd463e69d15acf5498232b9bc2bfeaa.tar.gz
cpython-5d7b90db0cd463e69d15acf5498232b9bc2bfeaa.tar.bz2
[3.12] gh-114737: Revert change to ElementTree.iterparse "root" attribute (GH-114755) (GH-114798)
Prior to gh-114269, the iterator returned by ElementTree.iterparse was initialized with the root attribute as None. This restores the previous behavior. (cherry picked from commit 66f95ea6a65deff547cab0d312b8c8c8a4cf8beb) Co-authored-by: Sam Gross <colesbury@gmail.com>
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_xml_etree.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py
index 53a4e9f..b50898f 100644
--- a/Lib/test/test_xml_etree.py
+++ b/Lib/test/test_xml_etree.py
@@ -536,7 +536,9 @@ class ElementTreeTest(unittest.TestCase):
iterparse = ET.iterparse
context = iterparse(SIMPLE_XMLFILE)
+ self.assertIsNone(context.root)
action, elem = next(context)
+ self.assertIsNone(context.root)
self.assertEqual((action, elem.tag), ('end', 'element'))
self.assertEqual([(action, elem.tag) for action, elem in context], [
('end', 'element'),