File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -513,3 +513,10 @@ def handle_pi(self, data):
513513 def unknown_decl (self , data ):
514514 if self .strict :
515515 self .error ("unknown declaration: %r" % (data ,))
516+
517+ # Internal -- helper to remove special character quoting
518+ def unescape (self , s ):
519+ warnings .warn ('The unescape method is deprecated and will be removed '
520+ 'in 3.5, use html.unescape() instead.' ,
521+ DeprecationWarning , stacklevel = 2 )
522+ return unescape (s )
Original file line number Diff line number Diff line change @@ -569,6 +569,13 @@ def test_EOF_in_charref(self):
569569 for html , expected in data :
570570 self ._run_check (html , expected )
571571
572+ def test_unescape_method (self ):
573+ from html import unescape
574+ p = self .get_collector ()
575+ with self .assertWarns (DeprecationWarning ):
576+ s = '""""""&#bad;'
577+ self .assertEqual (p .unescape (s ), unescape (s ))
578+
572579 def test_broken_comments (self ):
573580 html = ('<! not really a comment >'
574581 '<! not a comment either -->'
You can’t perform that action at this time.
0 commit comments