From 4c9ed82a2f4591446875d9cf9ff34c727c8bee6e Mon Sep 17 00:00:00 2001 From: "brett.cannon" Date: Sat, 16 Aug 2008 21:56:03 +0000 Subject: [PATCH] Silence the DeprecationWarning raised in httplib when mimetools is imported. git-svn-id: http://svn.python.org/projects/python/trunk@65719 6015fed2-1504-0410-9fe1-9d1591cc4771 --- Lib/httplib.py | 6 +++++- Misc/NEWS | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Lib/httplib.py b/Lib/httplib.py index 81020b7810..62cd0c7497 100644 --- a/Lib/httplib.py +++ b/Lib/httplib.py @@ -66,10 +66,14 @@ Req-started-unread-response _CS_REQ_STARTED Req-sent-unread-response _CS_REQ_SENT """ -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 diff --git a/Misc/NEWS b/Misc/NEWS index 53158d17de..5d1feea777 100644 --- 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. -- 2.11.4.GIT