Skip to content

bpo-29204: Add version since deprecation in XMLParser warnings #6763

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

Closed
wants to merge 1 commit into from
Closed
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: 2 additions & 1 deletion Lib/xml/etree/ElementTree.py
Original file line number Diff line number Diff line change
Expand Up @@ -1448,7 +1448,8 @@ class XMLParser:
def __init__(self, html=_sentinel, target=None, encoding=None):
if html is not _sentinel:
warnings.warn(
"The html argument of XMLParser() is deprecated",
"The html argument of XMLParser() is deprecated since 3.4"
" and will be ignored.",
DeprecationWarning, stacklevel=2)
try:
from xml.parsers import expat
Expand Down
3 changes: 2 additions & 1 deletion Modules/_elementtree.c
Original file line number Diff line number Diff line change
Expand Up @@ -3282,7 +3282,8 @@ _elementtree_XMLParser___init___impl(XMLParserObject *self, PyObject *html,
{
if (html != NULL) {
if (PyErr_WarnEx(PyExc_DeprecationWarning,
"The html argument of XMLParser() is deprecated",
"The html argument of XMLParser() is deprecated since"
" 3.4 and will be ignored.",
1) < 0) {
return -1;
}
Expand Down