@@ -40,11 +40,6 @@ def _test_selector_event(selector, fd, event):
40
40
return bool (key .events & event )
41
41
42
42
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
-
48
43
class BaseSelectorEventLoop (base_events .BaseEventLoop ):
49
44
"""Selector event loop.
50
45
@@ -366,7 +361,7 @@ async def sock_recv(self, sock, n):
366
361
The maximum amount of data to be received at once is specified by
367
362
nbytes.
368
363
"""
369
- _check_ssl_socket (sock )
364
+ base_events . _check_ssl_socket (sock )
370
365
if self ._debug and sock .gettimeout () != 0 :
371
366
raise ValueError ("the socket must be non-blocking" )
372
367
try :
@@ -407,7 +402,7 @@ async def sock_recv_into(self, sock, buf):
407
402
The received data is written into *buf* (a writable buffer).
408
403
The return value is the number of bytes written.
409
404
"""
410
- _check_ssl_socket (sock )
405
+ base_events . _check_ssl_socket (sock )
411
406
if self ._debug and sock .gettimeout () != 0 :
412
407
raise ValueError ("the socket must be non-blocking" )
413
408
try :
@@ -448,7 +443,7 @@ async def sock_sendall(self, sock, data):
448
443
raised, and there is no way to determine how much data, if any, was
449
444
successfully processed by the receiving end of the connection.
450
445
"""
451
- _check_ssl_socket (sock )
446
+ base_events . _check_ssl_socket (sock )
452
447
if self ._debug and sock .gettimeout () != 0 :
453
448
raise ValueError ("the socket must be non-blocking" )
454
449
try :
@@ -497,7 +492,7 @@ async def sock_connect(self, sock, address):
497
492
498
493
This method is a coroutine.
499
494
"""
500
- _check_ssl_socket (sock )
495
+ base_events . _check_ssl_socket (sock )
501
496
if self ._debug and sock .gettimeout () != 0 :
502
497
raise ValueError ("the socket must be non-blocking" )
503
498
@@ -562,7 +557,7 @@ async def sock_accept(self, sock):
562
557
object usable to send and receive data on the connection, and address
563
558
is the address bound to the socket on the other end of the connection.
564
559
"""
565
- _check_ssl_socket (sock )
560
+ base_events . _check_ssl_socket (sock )
566
561
if self ._debug and sock .gettimeout () != 0 :
567
562
raise ValueError ("the socket must be non-blocking" )
568
563
fut = self .create_future ()
0 commit comments