Commit be153864 authored by Denis Bilenko's avatar Denis Bilenko

gevent.monkey: add patch_httplib() function and 'httplib' argument to...

gevent.monkey: add patch_httplib() function and 'httplib' argument to patch_all() (disabled by default)

--HG--
extra : transplant_source : %FE%D2%A0%C5%AE%1D%0E%0D%C3u%8F%00YK%C4%B5%80Q%A4%87
parent 2cab6d54
......@@ -179,7 +179,13 @@ def patch_select(aggressive=False):
_select.__dict__.pop('kevent', None)
def patch_all(socket=True, dns=True, time=True, select=True, thread=True, os=True, ssl=True, aggressive=True):
def patch_httplib():
from gevent.httplib import HTTPConnection
httplib = __import__('httplib')
httplib.HTTPConnection = HTTPConnection
def patch_all(socket=True, dns=True, time=True, select=True, thread=True, os=True, ssl=True, httplib=False, aggressive=True):
"""Do all of the default monkey patching (calls every other function in this module."""
# order is important
if os:
......@@ -194,6 +200,8 @@ def patch_all(socket=True, dns=True, time=True, select=True, thread=True, os=Tru
patch_select(aggressive=aggressive)
if ssl:
patch_ssl()
if httplib:
patch_httplib()
if __name__ == '__main__':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment