Silence DeprecationWarning raised by mimetools and rfc822 in cgi.
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 @@
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: