diff options
Diffstat (limited to 'tests/cgiapp_data/form.cgi')
-rwxr-xr-x | tests/cgiapp_data/form.cgi | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/cgiapp_data/form.cgi b/tests/cgiapp_data/form.cgi index c4c562d..5ad8f68 100755 --- a/tests/cgiapp_data/form.cgi +++ b/tests/cgiapp_data/form.cgi @@ -2,13 +2,20 @@ from __future__ import print_function +import sys + +# Quiet warnings in this CGI so that it does not upset tests. +if not sys.warnoptions: + import warnings + warnings.simplefilter("ignore") + +# TODO: cgi is deprecated and will go away in Python 3.13. import cgi -import six print('Content-type: text/plain') print('') -if six.PY3: +if sys.version_info.major >= 3: # Python 3: cgi.FieldStorage keeps some field names as unicode and some as # the repr() of byte strings, duh. |