Replace deprecated cgi.escape with html.escape
This commit is contained in:
parent
3b2e214bf1
commit
4f3b738f6f
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import argparse
|
import argparse
|
||||||
import cgi
|
import html
|
||||||
import tempfile
|
import tempfile
|
||||||
import os.path
|
import os.path
|
||||||
import threading
|
import threading
|
||||||
|
@ -390,7 +390,7 @@ class BServer:
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>""" + _("An error occurred!") + "</h1>" +
|
<h1>""" + _("An error occurred!") + "</h1>" +
|
||||||
"".join(u"<p>%s</p>" % cgi.escape(s) for s in type(u"")(e).split(u"\n")) +
|
"".join(u"<p>%s</p>" % html.escape(s) for s in type(u"")(e).split(u"\n")) +
|
||||||
"""
|
"""
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -466,7 +466,7 @@ class BServer:
|
||||||
kv = a.split('=')
|
kv = a.split('=')
|
||||||
if len(kv) == 2:
|
if len(kv) == 2:
|
||||||
k, v = kv
|
k, v = kv
|
||||||
defaults[k] = cgi.escape(v, True)
|
defaults[k] = html.escape(v, True)
|
||||||
start_response(status, headers)
|
start_response(status, headers)
|
||||||
return self.args2html(name, box, lang, "./" + name, defaults=defaults)
|
return self.args2html(name, box, lang, "./" + name, defaults=defaults)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue