]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Silence the DeprecationWarning raised in httplib when mimetools is imported.
authorBrett Cannon <bcannon@gmail.com>
Sat, 16 Aug 2008 21:56:03 +0000 (21:56 +0000)
committerBrett Cannon <bcannon@gmail.com>
Sat, 16 Aug 2008 21:56:03 +0000 (21:56 +0000)
Lib/httplib.py
Misc/NEWS

index 81020b7810f6bceca1a54f81a4ab9bf230ee7514..62cd0c74974f908b79ab52fbeea0855f0aba5925 100644 (file)
@@ -66,10 +66,14 @@ Req-started-unread-response    _CS_REQ_STARTED    <response_class>
 Req-sent-unread-response       _CS_REQ_SENT       <response_class>
 """
 
-import mimetools
 import socket
 from urlparse import urlsplit
 import warnings
+from test.test_support import catch_warning
+with catch_warning(record=False):
+    warnings.filterwarnings("ignore", ".*mimetools has been removed",
+                            DeprecationWarning)
+    import mimetools
 
 try:
     from cStringIO import StringIO
index 53158d17de31d62e766c33117b810def60ebeb27..5d1feea77715095f94278f7af211d57834ff89ec 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -49,7 +49,7 @@ Library
 -------
 
 - Silence the DeprecationWarning raised when importing mimetools in
-  BaseHTTPServer.
+  BaseHTTPServer, httplib.
 
 - 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.