Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
3293593b
Commit
3293593b
authored
Dec 24, 2009
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix alleged refleak
parent
9f12d468
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
Lib/test/test_urllib2.py
Lib/test/test_urllib2.py
+8
-3
No files found.
Lib/test/test_urllib2.py
View file @
3293593b
...
...
@@ -292,10 +292,11 @@ class MockHTTPClass:
self
.
_tunnel_headers
=
headers
else
:
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
.
selector
=
url
self
.
req_headers
+=
headers
.
items
()
if
headers
is
not
None
:
self
.
req_headers
+=
headers
.
items
()
self
.
req_headers
.
sort
()
if
body
:
self
.
data
=
body
...
...
@@ -415,7 +416,11 @@ class MockHTTPHandler(urllib2.BaseHandler):
class
MockHTTPSHandler
(
urllib2
.
AbstractHTTPHandler
):
# Useful for testing the Proxy-Authorization request by verifying the
# properties of httpcon
httpconn
=
MockHTTPClass
()
def
__init__
(
self
):
urllib2
.
AbstractHTTPHandler
.
__init__
(
self
)
self
.
httpconn
=
MockHTTPClass
()
def
https_open
(
self
,
req
):
return
self
.
do_open
(
self
.
httpconn
,
req
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment