Mercurial > p > roundup > code
changeset 8499:7c49a4267705
bug: supress deprecation warning when importing cgi module
cgi was removed in 3.13, but it is vendored in Roundup.
So we don't need to see the warning.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Mon, 15 Dec 2025 17:31:37 -0500 |
| parents | 4a8a29825987 |
| children | b03160d46e9d |
| files | roundup/anypy/cgi_.py |
| diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/roundup/anypy/cgi_.py Mon Dec 15 09:46:01 2025 -0500 +++ b/roundup/anypy/cgi_.py Mon Dec 15 17:31:37 2025 -0500 @@ -1,7 +1,10 @@ # ruff: noqa: F401 - unused imports +import warnings try: # used for python2 and python 3 < 3.13 - import cgi + with warnings.catch_warnings(): + warnings.filterwarnings('ignore', category=DeprecationWarning) + import cgi from cgi import FieldStorage, MiniFieldStorage except ImportError: # use for python3 >= 3.13
