Skip to content

Commit 4e0a81f

Browse files
keith-packardphillmv
authored andcommitted
Make normalize test compatible with python 3.8
Python 3.8 has removed the cgi.escape function, which had been deprecated since version 3.2. html.escape does the same thing, use that instead. Signed-off-by: Keith Packard <[email protected]>
1 parent 2b2ffaf commit 4e0a81f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/normalize.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# -*- coding: utf-8 -*-
22
from html.parser import HTMLParser
33
import urllib
4+
import html
45

56
try:
67
from html.parser import HTMLParseError
@@ -66,7 +67,7 @@ def handle_starttag(self, tag, attrs):
6667
self.output += ("=" + '"' +
6768
urllib.quote(urllib.unquote(v), safe='/') + '"')
6869
elif v != None:
69-
self.output += ("=" + '"' + cgi.escape(v,quote=True) + '"')
70+
self.output += ("=" + '"' + html.escape(v,quote=True) + '"')
7071
self.output += ">"
7172
self.last_tag = tag
7273
self.last = "starttag"

0 commit comments

Comments
 (0)