summaryrefslogtreecommitdiff
path: root/docs/tutorials/wiki2/src
diff options
context:
space:
mode:
authorJeremy Chen <jeremy886@gmail.com>2017-04-10 14:55:46 +1000
committerGitHub <noreply@github.com>2017-04-10 14:55:46 +1000
commit1bd681193feef31d032c13e7022bc2d65d9e0a21 (patch)
tree496e70274ce8447ae44b0f0172b33b3984de47e8 /docs/tutorials/wiki2/src
parent6014cb479c484f5672e259460ca6c221e5972a19 (diff)
downloadpyramid-1bd681193feef31d032c13e7022bc2d65d9e0a21.tar.gz
pyramid-1bd681193feef31d032c13e7022bc2d65d9e0a21.tar.bz2
pyramid-1bd681193feef31d032c13e7022bc2d65d9e0a21.zip
replace deprecated cgi.escape() with html.escape()
As suggested by https://docs.python.org/3.6/library/cgi.html cgi.escape() Deprecated since version 3.2: This function is unsafe because quote is false by default, and therefore deprecated. Use html.escape() instead.
Diffstat (limited to 'docs/tutorials/wiki2/src')
-rw-r--r--docs/tutorials/wiki2/src/views/tutorial/views/default.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/tutorials/wiki2/src/views/tutorial/views/default.py b/docs/tutorials/wiki2/src/views/tutorial/views/default.py
index bb6300b75..0a05b33e6 100644
--- a/docs/tutorials/wiki2/src/views/tutorial/views/default.py
+++ b/docs/tutorials/wiki2/src/views/tutorial/views/default.py
@@ -1,4 +1,4 @@
-import cgi
+import html
import re
from docutils.core import publish_parts
@@ -31,10 +31,10 @@ def view_page(request):
exists = request.dbsession.query(Page).filter_by(name=word).all()
if exists:
view_url = request.route_url('view_page', pagename=word)
- return '<a href="%s">%s</a>' % (view_url, cgi.escape(word))
+ return '<a href="%s">%s</a>' % (view_url, html.escape(word))
else:
add_url = request.route_url('add_page', pagename=word)
- return '<a href="%s">%s</a>' % (add_url, cgi.escape(word))
+ return '<a href="%s">%s</a>' % (add_url, html.escape(word))
content = publish_parts(page.data, writer_name='html')['html_body']
content = wikiwords.sub(add_link, content)