bpo-37328: remove deprecated HTMLParser.unescape (GH-14186)
It is deprecated since Python 3.4.
This commit is contained in:
parent
9a943b4ce1
commit
fae0ed5099
|
@ -9,7 +9,6 @@
|
||||||
|
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import warnings
|
|
||||||
import _markupbase
|
import _markupbase
|
||||||
|
|
||||||
from html import unescape
|
from html import unescape
|
||||||
|
@ -461,10 +460,3 @@ class HTMLParser(_markupbase.ParserBase):
|
||||||
|
|
||||||
def unknown_decl(self, data):
|
def unknown_decl(self, data):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# Internal -- helper to remove special character quoting
|
|
||||||
def unescape(self, s):
|
|
||||||
warnings.warn('The unescape method is deprecated and will be removed '
|
|
||||||
'in 3.5, use html.unescape() instead.',
|
|
||||||
DeprecationWarning, stacklevel=2)
|
|
||||||
return unescape(s)
|
|
||||||
|
|
|
@ -573,13 +573,6 @@ text
|
||||||
for html, expected in data:
|
for html, expected in data:
|
||||||
self._run_check(html, expected)
|
self._run_check(html, expected)
|
||||||
|
|
||||||
def test_unescape_method(self):
|
|
||||||
from html import unescape
|
|
||||||
p = self.get_collector()
|
|
||||||
with self.assertWarns(DeprecationWarning):
|
|
||||||
s = '""""""&#bad;'
|
|
||||||
self.assertEqual(p.unescape(s), unescape(s))
|
|
||||||
|
|
||||||
def test_broken_comments(self):
|
def test_broken_comments(self):
|
||||||
html = ('<! not really a comment >'
|
html = ('<! not really a comment >'
|
||||||
'<! not a comment either -->'
|
'<! not a comment either -->'
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
``HTMLParser.unescape`` is removed. It was undocumented and deprecated
|
||||||
|
since Python 3.4.
|
Loading…
Reference in New Issue