annotate roundup/anypy/html.py @ 5955:5dca9925e8a6

Added tag 2.0.0alpha0 for changeset d7ff9cb70f34
author John Rouillard <rouilj@ieee.org>
date Wed, 23 Oct 2019 14:33:53 -0400
parents 883c9e90b403
children ff57db595a58
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5837
883c9e90b403 Fix problem with cgi.escape being depricated a different way. This way
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
1 try:
883c9e90b403 Fix problem with cgi.escape being depricated a different way. This way
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
2 from html import escape as html_escape_ # python 3
883c9e90b403 Fix problem with cgi.escape being depricated a different way. This way
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
3 def html_escape(str, quote=False):
883c9e90b403 Fix problem with cgi.escape being depricated a different way. This way
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
4 # html_escape under python 3 sets quote to true by default
883c9e90b403 Fix problem with cgi.escape being depricated a different way. This way
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
5 # make it python 2 compatible
883c9e90b403 Fix problem with cgi.escape being depricated a different way. This way
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
6 return html_escape_(str, quote=quote)
883c9e90b403 Fix problem with cgi.escape being depricated a different way. This way
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
7 except ImportError:
883c9e90b403 Fix problem with cgi.escape being depricated a different way. This way
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
8 from cgi import escape as html_escape # python 2 fallback

Roundup Issue Tracker: http://roundup-tracker.org/