Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
a130025d
Commit
a130025d
authored
Apr 11, 2011
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix Issue 71: gevent.httplib doesn't support HTTPSConnection. Patch by snb at spotify.
parent
2559aceb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
gevent/httplib.py
gevent/httplib.py
+9
-1
gevent/monkey.py
gevent/monkey.py
+2
-1
No files found.
gevent/httplib.py
View file @
a130025d
# Copyright (C) 2010-2011 gevent contributors. See LICENSE for details.
__httplib__
=
__import__
(
'httplib'
)
# Get the standard Python httplib as __httplib__, ensuring we get a version
# that hasn't already been modified by monkey patching of any of its members.
# HTTPSConnection must use the standard HTTPConnection because libevent-http
# does not currently support https.
import
imp
__httplib__
=
imp
.
load_module
(
'__httplib__'
,
*
imp
.
find_module
(
'httplib'
))
from
gevent
import
core
from
gevent.hub
import
Waiter
,
get_hub
...
...
@@ -10,6 +16,7 @@ __implements__ = [
]
__imports__
=
[
'HTTPSConnection'
,
'HTTPException'
,
'InvalidURL'
,
]
...
...
@@ -19,6 +26,7 @@ __all__ = __implements__ + __imports__
InvalidURL
=
__httplib__
.
InvalidURL
HTTP_PORT
=
__httplib__
.
HTTP_PORT
HTTPException
=
__httplib__
.
HTTPException
HTTPSConnection
=
__httplib__
.
HTTPSConnection
EV_METHOD_TYPES
=
dict
((
name
,
id
)
for
(
id
,
name
)
in
core
.
HTTP_method2name
.
items
())
...
...
gevent/monkey.py
View file @
a130025d
...
...
@@ -180,9 +180,10 @@ def patch_select(aggressive=False):
def
patch_httplib
():
from
gevent.httplib
import
HTTPConnection
httplib
=
__import__
(
'httplib'
)
from
gevent.httplib
import
HTTPConnection
,
HTTPSConnection
httplib
.
HTTPConnection
=
HTTPConnection
httplib
.
HTTPSConnection
=
HTTPSConnection
def
patch_all
(
socket
=
True
,
dns
=
True
,
time
=
True
,
select
=
True
,
thread
=
True
,
os
=
True
,
ssl
=
True
,
httplib
=
False
,
aggressive
=
True
):
...
...
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