greenio: save the reference to the original socket in case it will be monkey patched
This commit is contained in:
@@ -31,6 +31,7 @@ BUFFER_SIZE = 4096
|
|||||||
import errno
|
import errno
|
||||||
import os
|
import os
|
||||||
import socket
|
import socket
|
||||||
|
from socket import socket as _original_socket
|
||||||
import fcntl
|
import fcntl
|
||||||
import time
|
import time
|
||||||
|
|
||||||
@@ -183,7 +184,7 @@ class GreenSocket(object):
|
|||||||
timeout = None
|
timeout = None
|
||||||
def __init__(self, family_or_realsock=socket.AF_INET, *args, **kwargs):
|
def __init__(self, family_or_realsock=socket.AF_INET, *args, **kwargs):
|
||||||
if isinstance(family_or_realsock, (int, long)):
|
if isinstance(family_or_realsock, (int, long)):
|
||||||
fd = socket.socket(family_or_realsock, *args, **kwargs)
|
fd = _original_socket(family_or_realsock, *args, **kwargs)
|
||||||
else:
|
else:
|
||||||
fd = family_or_realsock
|
fd = family_or_realsock
|
||||||
assert not args, args
|
assert not args, args
|
||||||
|
Reference in New Issue
Block a user