"Fossies" - the Fresh Open Source Software Archive

Member "roundup-2.0.0/roundup/anypy/html.py" (29 Feb 2020, 352 Bytes) of package /linux/www/roundup-2.0.0.tar.gz:

As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 try:
    2     from html import escape as html_escape_  # python 3
    4     def html_escape(str, quote=False):
    5         # html_escape under python 3 sets quote to true by default
    6         # make it python 2 compatible
    7         return html_escape_(str, quote=quote)
    8 except ImportError:
    9     # python 2 fallback
   10     from cgi import escape as html_escape  # noqa: F401