@@ -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
@@ -357,7 +352,7 @@ async def sock_recv(self, sock, n):
357
352
The maximum amount of data to be received at once is specified by
358
353
nbytes.
359
354
"""
360
- _check_ssl_socket (sock )
355
+ base_events . _check_ssl_socket (sock )
361
356
if self ._debug and sock .gettimeout () != 0 :
362
357
raise ValueError ("the socket must be non-blocking" )
363
358
try :
@@ -398,7 +393,7 @@ async def sock_recv_into(self, sock, buf):
398
393
The received data is written into *buf* (a writable buffer).
399
394
The return value is the number of bytes written.
400
395
"""
401
- _check_ssl_socket (sock )
396
+ base_events . _check_ssl_socket (sock )
402
397
if self ._debug and sock .gettimeout () != 0 :
403
398
raise ValueError ("the socket must be non-blocking" )
404
399
try :
@@ -439,7 +434,7 @@ async def sock_sendall(self, sock, data):
439
434
raised, and there is no way to determine how much data, if any, was
440
435
successfully processed by the receiving end of the connection.
441
436
"""
442
- _check_ssl_socket (sock )
437
+ base_events . _check_ssl_socket (sock )
443
438
if self ._debug and sock .gettimeout () != 0 :
444
439
raise ValueError ("the socket must be non-blocking" )
445
440
try :
@@ -488,7 +483,7 @@ async def sock_connect(self, sock, address):
488
483
489
484
This method is a coroutine.
490
485
"""
491
- _check_ssl_socket (sock )
486
+ base_events . _check_ssl_socket (sock )
492
487
if self ._debug and sock .gettimeout () != 0 :
493
488
raise ValueError ("the socket must be non-blocking" )
494
489
@@ -553,7 +548,7 @@ async def sock_accept(self, sock):
553
548
object usable to send and receive data on the connection, and address
554
549
is the address bound to the socket on the other end of the connection.
555
550
"""
556
- _check_ssl_socket (sock )
551
+ base_events . _check_ssl_socket (sock )
557
552
if self ._debug and sock .gettimeout () != 0 :
558
553
raise ValueError ("the socket must be non-blocking" )
559
554
fut = self .create_future ()
0 commit comments