Fix and check cgi module deprecation warnings. Revert an unwanted rename in test_import.
diff --git a/Lib/cgi.py b/Lib/cgi.py
index db10a62..310dc02 100755
--- a/Lib/cgi.py
+++ b/Lib/cgi.py
@@ -45,10 +45,10 @@
with catch_warnings():
if sys.py3kwarning:
filterwarnings("ignore", ".*mimetools has been removed",
- DeprecationWarning)
+ DeprecationWarning)
+ filterwarnings("ignore", ".*rfc822 has been removed",
+ DeprecationWarning)
import mimetools
- if sys.py3kwarning:
- filterwarnings("ignore", ".*rfc822 has been removed", DeprecationWarning)
import rfc822
try:
@@ -180,8 +180,8 @@
def parse_qs(qs, keep_blank_values=0, strict_parsing=0):
"""Parse a query given as a string argument."""
- warn("cgi.parse_qs is deprecated, use urlparse.parse_qs \
- instead", PendingDeprecationWarning, 2)
+ warn("cgi.parse_qs is deprecated, use urlparse.parse_qs instead",
+ PendingDeprecationWarning, 2)
return urlparse.parse_qs(qs, keep_blank_values, strict_parsing)