Kaydet (Commit) abe423ed authored tarafından Brett Cannon's avatar Brett Cannon

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.
üst 1e296cc8
......@@ -73,7 +73,12 @@ __all__ = ["HTTPServer", "BaseHTTPRequestHandler"]
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
......
......@@ -48,6 +48,9 @@ Core and Builtins
Library
-------
- Silence the DeprecationWarning raised when importing mimetools in
BaseHTTPServer.
- Issue #2776: fixed small issue when handling an URL with double slash
after a 302 response in the case of not going through a proxy.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment