@@ -40,11 +40,6 @@ def _test_selector_event(selector, fd, event):
4040 return bool (key .events & event )
4141
4242
43- def _check_ssl_socket (sock ):
44- if ssl is not None and isinstance (sock , ssl .SSLSocket ):
45- raise TypeError ("Socket cannot be of type SSLSocket" )
46-
47-
4843class BaseSelectorEventLoop (base_events .BaseEventLoop ):
4944 """Selector event loop.
5045
@@ -357,7 +352,7 @@ async def sock_recv(self, sock, n):
357352 The maximum amount of data to be received at once is specified by
358353 nbytes.
359354 """
360- _check_ssl_socket (sock )
355+ base_events . _check_ssl_socket (sock )
361356 if self ._debug and sock .gettimeout () != 0 :
362357 raise ValueError ("the socket must be non-blocking" )
363358 try :
@@ -398,7 +393,7 @@ async def sock_recv_into(self, sock, buf):
398393 The received data is written into *buf* (a writable buffer).
399394 The return value is the number of bytes written.
400395 """
401- _check_ssl_socket (sock )
396+ base_events . _check_ssl_socket (sock )
402397 if self ._debug and sock .gettimeout () != 0 :
403398 raise ValueError ("the socket must be non-blocking" )
404399 try :
@@ -439,7 +434,7 @@ async def sock_sendall(self, sock, data):
439434 raised, and there is no way to determine how much data, if any, was
440435 successfully processed by the receiving end of the connection.
441436 """
442- _check_ssl_socket (sock )
437+ base_events . _check_ssl_socket (sock )
443438 if self ._debug and sock .gettimeout () != 0 :
444439 raise ValueError ("the socket must be non-blocking" )
445440 try :
@@ -488,13 +483,15 @@ async def sock_connect(self, sock, address):
488483
489484 This method is a coroutine.
490485 """
491- _check_ssl_socket (sock )
486+ base_events . _check_ssl_socket (sock )
492487 if self ._debug and sock .gettimeout () != 0 :
493488 raise ValueError ("the socket must be non-blocking" )
494489
495490 if not hasattr (socket , 'AF_UNIX' ) or sock .family != socket .AF_UNIX :
496491 resolved = await self ._ensure_resolved (
497- address , family = sock .family , proto = sock .proto , loop = self )
492+ address , family = sock .family , type = sock .type , proto = sock .proto ,
493+ loop = self ,
494+ )
498495 _ , _ , _ , _ , address = resolved [0 ]
499496
500497 fut = self .create_future ()
@@ -553,7 +550,7 @@ async def sock_accept(self, sock):
553550 object usable to send and receive data on the connection, and address
554551 is the address bound to the socket on the other end of the connection.
555552 """
556- _check_ssl_socket (sock )
553+ base_events . _check_ssl_socket (sock )
557554 if self ._debug and sock .gettimeout () != 0 :
558555 raise ValueError ("the socket must be non-blocking" )
559556 fut = self .create_future ()
0 commit comments