mirror of
https://github.com/python/cpython.git
synced 2025-11-26 13:22:51 +00:00
Merged revisions 77014 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r77014 | benjamin.peterson | 2009-12-23 19:09:53 -0600 (Wed, 23 Dec 2009) | 1 line fix alleged refleak ........
This commit is contained in:
parent
6628a10034
commit
3d5b8db049
1 changed files with 8 additions and 3 deletions
|
|
@ -301,10 +301,11 @@ class MockHTTPClass:
|
||||||
else:
|
else:
|
||||||
self._tunnel_headers.clear()
|
self._tunnel_headers.clear()
|
||||||
|
|
||||||
def request(self, method, url, body=None, headers={}):
|
def request(self, method, url, body=None, headers=None):
|
||||||
self.method = method
|
self.method = method
|
||||||
self.selector = url
|
self.selector = url
|
||||||
self.req_headers += headers.items()
|
if headers is not None:
|
||||||
|
self.req_headers += headers.items()
|
||||||
self.req_headers.sort()
|
self.req_headers.sort()
|
||||||
if body:
|
if body:
|
||||||
self.data = body
|
self.data = body
|
||||||
|
|
@ -424,7 +425,11 @@ class MockHTTPHandler(urllib.request.BaseHandler):
|
||||||
class MockHTTPSHandler(urllib.request.AbstractHTTPHandler):
|
class MockHTTPSHandler(urllib.request.AbstractHTTPHandler):
|
||||||
# Useful for testing the Proxy-Authorization request by verifying the
|
# Useful for testing the Proxy-Authorization request by verifying the
|
||||||
# properties of httpcon
|
# properties of httpcon
|
||||||
httpconn = MockHTTPClass()
|
|
||||||
|
def __init__(self):
|
||||||
|
urllib.request.AbstractHTTPHandler.__init__(self)
|
||||||
|
self.httpconn = MockHTTPClass()
|
||||||
|
|
||||||
def https_open(self, req):
|
def https_open(self, req):
|
||||||
return self.do_open(self.httpconn, req)
|
return self.do_open(self.httpconn, req)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue