Commit 73b5936f authored by Denis Bilenko's avatar Denis Bilenko

monkey: fix patch_socket() to expect that ssl may not be present in socket...

monkey: fix patch_socket() to expect that ssl may not be present in socket module; also patch sslerror too
parent 134cf17f
......@@ -42,12 +42,17 @@ def patch_thread():
def patch_socket(dns=True):
from gevent.socket import socket, fromfd, ssl, socketpair
from gevent.socket import socket, fromfd, socketpair
_socket = __import__('socket')
_socket.socket = socket
_socket.fromfd = fromfd
_socket.ssl = ssl
_socket.socketpair = socketpair
try:
from gevent.socket import ssl, sslerror
_socket.ssl = ssl
_socket.sslerror = sslerror
except ImportError:
pass
if dns:
patch_dns()
......
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