summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_urllib2.py
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2008-06-12 04:06:45 (GMT)
committerBarry Warsaw <barry@python.org>2008-06-12 04:06:45 (GMT)
commit820c1200597606f95bb996586be88a3283c6448c (patch)
tree1b914ab96ccc9cd81465a6c3e765c97f128fd464 /Lib/test/test_urllib2.py
parent75f25f2c9a4646746efbc056b4d2a07b40f93964 (diff)
downloadcpython-820c1200597606f95bb996586be88a3283c6448c.zip
cpython-820c1200597606f95bb996586be88a3283c6448c.tar.gz
cpython-820c1200597606f95bb996586be88a3283c6448c.tar.bz2
Patch for issue 2848, mostly by Humberto Diogenes, with a couple of
small fixes by Barry. This removes mimetools from the stdlib.
Diffstat (limited to 'Lib/test/test_urllib2.py')
-rw-r--r--Lib/test/test_urllib2.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py
index c2d594b..6bcb17e 100644
--- a/Lib/test/test_urllib2.py
+++ b/Lib/test/test_urllib2.py
@@ -349,18 +349,18 @@ class MockHTTPHandler(urllib2.BaseHandler):
self._count = 0
self.requests = []
def http_open(self, req):
- import mimetools, http.client, copy
+ import email, http.client, copy
from io import StringIO
self.requests.append(copy.deepcopy(req))
if self._count == 0:
self._count = self._count + 1
name = http.client.responses[self.code]
- msg = mimetools.Message(StringIO(self.headers))
+ msg = email.message_from_string(self.headers)
return self.parent.error(
"http", req, MockFile(), self.code, name, msg)
else:
self.req = req
- msg = mimetools.Message(StringIO("\r\n\r\n"))
+ msg = email.message_from_string("\r\n\r\n")
return MockResponse(200, "OK", msg, "", req.get_full_url())
class MockPasswordManager: