Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dcfebb3

Browse files
committed
Issue #26676: Add missing XMLPullParser to ElementTree.__all__
1 parent 0a85c69 commit dcfebb3

4 files changed

Lines changed: 9 additions & 4 deletions

File tree

Doc/whatsnew/3.6.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,8 @@ Changes in the Python API
460460

461461
* The following modules have had missing APIs added to their :attr:`__all__`
462462
attributes to match the documented APIs: :mod:`calendar`, :mod:`csv`,
463-
:mod:`enum`, :mod:`fileinput`, :mod:`ftplib`, :mod:`logging`,
463+
:mod:`~xml.etree.ElementTree`, :mod:`enum`,
464+
:mod:`fileinput`, :mod:`ftplib`, :mod:`logging`,
464465
:mod:`optparse`, :mod:`tarfile`, :mod:`threading` and
465466
:mod:`wave`. This means they will export new symbols when ``import *``
466467
is used. See :issue:`23883`.

Lib/test/test_xml_etree.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,17 @@
9191

9292

9393
class ModuleTest(unittest.TestCase):
94-
# TODO: this should be removed once we get rid of the global module vars
95-
9694
def test_sanity(self):
9795
# Import sanity.
9896

9997
from xml.etree import ElementTree
10098
from xml.etree import ElementInclude
10199
from xml.etree import ElementPath
102100

101+
def test_all(self):
102+
names = ("xml.etree.ElementTree", "_elementtree")
103+
support.check__all__(self, ET, names, blacklist=("HTML_EMPTY",))
104+
103105

104106
def serialize(elem, to_string=True, encoding='unicode', **options):
105107
if encoding != 'unicode':

Lib/xml/etree/ElementTree.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
"TreeBuilder",
8686
"VERSION",
8787
"XML", "XMLID",
88-
"XMLParser",
88+
"XMLParser", "XMLPullParser",
8989
"register_namespace",
9090
]
9191

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,8 @@ Core and Builtins
237237
Library
238238
-------
239239

240+
- Issue #26676: Added missing XMLPullParser to ElementTree.__all__.
241+
240242
- Issue #22854: Change BufferedReader.writable() and
241243
BufferedWriter.readable() to always return False.
242244

0 commit comments

Comments
 (0)