Skip to content

Commit b0ada0c

Browse files
methanelisroach
authored andcommitted
bpo-37328: remove deprecated HTMLParser.unescape (pythonGH-14186)
It is deprecated since Python 3.4.
1 parent b83f673 commit b0ada0c

File tree

3 files changed

+2
-15
lines changed

3 files changed

+2
-15
lines changed

Lib/html/parser.py

-8
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010

1111
import re
12-
import warnings
1312
import _markupbase
1413

1514
from html import unescape
@@ -461,10 +460,3 @@ def handle_pi(self, data):
461460

462461
def unknown_decl(self, data):
463462
pass
464-
465-
# Internal -- helper to remove special character quoting
466-
def unescape(self, s):
467-
warnings.warn('The unescape method is deprecated and will be removed '
468-
'in 3.5, use html.unescape() instead.',
469-
DeprecationWarning, stacklevel=2)
470-
return unescape(s)

Lib/test/test_htmlparser.py

-7
Original file line numberDiff line numberDiff line change
@@ -573,13 +573,6 @@ def test_EOF_in_charref(self):
573573
for html, expected in data:
574574
self._run_check(html, expected)
575575

576-
def test_unescape_method(self):
577-
from html import unescape
578-
p = self.get_collector()
579-
with self.assertWarns(DeprecationWarning):
580-
s = '"""&quot&#34&#x22&#bad;'
581-
self.assertEqual(p.unescape(s), unescape(s))
582-
583576
def test_broken_comments(self):
584577
html = ('<! not really a comment >'
585578
'<! not a comment either -->'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
``HTMLParser.unescape`` is removed. It was undocumented and deprecated
2+
since Python 3.4.

0 commit comments

Comments
 (0)