[Python-checkins] r65719 - in python/trunk: Lib/httplib.py Misc/NEWS

brett.cannon python-checkins at python.org
Sat Aug 16 23:56:04 CEST 2008


Author: brett.cannon
Date: Sat Aug 16 23:56:03 2008
New Revision: 65719

Log:
Silence the DeprecationWarning raised in httplib when mimetools is imported.


Modified:
   python/trunk/Lib/httplib.py
   python/trunk/Misc/NEWS

Modified: python/trunk/Lib/httplib.py
==============================================================================
--- python/trunk/Lib/httplib.py	(original)
+++ python/trunk/Lib/httplib.py	Sat Aug 16 23:56:03 2008
@@ -66,10 +66,14 @@
 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

Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS	(original)
+++ python/trunk/Misc/NEWS	Sat Aug 16 23:56:03 2008
@@ -49,7 +49,7 @@
 -------
 
 - 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.


More information about the Python-checkins mailing list