view roundup/anypy/html.py @ 5838:b74f0b50bef1

Fix CI deprication warning for HTMLParser convert_charrefs under py3. /home/travis/build/roundup-tracker/roundup/roundup/dehtml.py:81: DeprecationWarning: The value of convert_charrefs will become True in 3.5. You are encouraged to set the value explicitly. parser = DumbHTMLParser()
author John Rouillard <rouilj@ieee.org>
date Sat, 06 Jul 2019 17:36:25 -0400
parents 883c9e90b403
children ff57db595a58
line wrap: on
line source

try:
    from html import escape as html_escape_ # python 3
    def html_escape(str, quote=False):
        # html_escape under python 3 sets quote to true by default
        # make it python 2 compatible
        return html_escape_(str, quote=quote)
except ImportError:
    from cgi import escape as html_escape # python 2 fallback

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