Mercurial > p > roundup > code
comparison roundup/anypy/html.py @ 7769:7f888f046857
chore: ruff lint: replace str variable name with string
str is a type in python.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Sat, 02 Mar 2024 04:14:18 -0500 |
| parents | ff57db595a58 |
| children |
comparison
equal
deleted
inserted
replaced
| 7768:609c5fd638e8 | 7769:7f888f046857 |
|---|---|
| 1 try: | 1 try: |
| 2 from html import escape as html_escape_ # python 3 | 2 from html import escape as html_escape_ # python 3 |
| 3 | 3 |
| 4 def html_escape(str, quote=False): | 4 def html_escape(string, quote=False): |
| 5 # html_escape under python 3 sets quote to true by default | 5 # html_escape under python 3 sets quote to true by default |
| 6 # make it python 2 compatible | 6 # make it python 2 compatible |
| 7 return html_escape_(str, quote=quote) | 7 return html_escape_(string, quote=quote) |
| 8 except ImportError: | 8 except ImportError: |
| 9 # python 2 fallback | 9 # python 2 fallback |
| 10 from cgi import escape as html_escape # noqa: F401 | 10 from cgi import escape as html_escape # noqa: F401 |
