Skip to content

Commit 40200f2

Browse files
committed
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.
1 parent 78409c3 commit 40200f2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

roundup/anypy/cgi_.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# ruff: noqa: F401 - unused imports
2+
import warnings
23
try:
34
# used for python2 and python 3 < 3.13
4-
import cgi
5+
with warnings.catch_warnings():
6+
warnings.filterwarnings('ignore', category=DeprecationWarning)
7+
import cgi
58
from cgi import FieldStorage, MiniFieldStorage
69
except ImportError:
710
# use for python3 >= 3.13

0 commit comments

Comments
 (0)