Silence the DeprecationWarning raised by importing mimetools in BaseHTTPServer.
This does have an unfortunate side-effect of silencing the warning for all
subsequent code that imports mimetools as well since the warning is only
executed upon the first import of mimetools.
diff --git a/Lib/BaseHTTPServer.py b/Lib/BaseHTTPServer.py
index 5f2d558..0a6381e 100644
--- a/Lib/BaseHTTPServer.py
+++ b/Lib/BaseHTTPServer.py
@@ -73,7 +73,12 @@
import sys
import time
import socket # For gethostbyaddr()
-import mimetools
+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
import SocketServer
# Default error message template