summaryrefslogtreecommitdiffstats
path: root/Lib/cgi.py
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2008-08-16 22:00:27 (GMT)
committerBrett Cannon <bcannon@gmail.com>2008-08-16 22:00:27 (GMT)
commit721b1457a0e36e49fe7f94a8f826661aa871fb08 (patch)
tree248753b36ae96e8a838931c73ce68808f5d1e30c /Lib/cgi.py
parent0a4128eae2dd808750b7196151ab3d7a99585353 (diff)
downloadcpython-721b1457a0e36e49fe7f94a8f826661aa871fb08.zip
cpython-721b1457a0e36e49fe7f94a8f826661aa871fb08.tar.gz
cpython-721b1457a0e36e49fe7f94a8f826661aa871fb08.tar.bz2
Silence DeprecationWarning raised by mimetools and rfc822 in cgi.
Diffstat (limited to 'Lib/cgi.py')
-rwxr-xr-xLib/cgi.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/Lib/cgi.py b/Lib/cgi.py
index 561f5ad..3a795c9 100755
--- a/Lib/cgi.py
+++ b/Lib/cgi.py
@@ -38,9 +38,16 @@ from operator import attrgetter
import sys
import os
import urllib
-import mimetools
-import rfc822
import UserDict
+from test.test_support import catch_warning
+from warnings import filterwarnings
+with catch_warning(record=False):
+ filterwarnings("ignore", ".*mimetools has been removed",
+ DeprecationWarning)
+ import mimetools
+ filterwarnings("ignore", ".*rfc822 has been removed", DeprecationWarning)
+ import rfc822
+
try:
from cStringIO import StringIO
except ImportError: