@@ -10,8 +10,10 @@ from typing_extensions import Literal, Self
1010from .events import AbstractEventLoop
1111from .futures import Future
1212
13- if sys .version_info >= (3 , 11 ):
13+ if sys .version_info >= (3 , 10 ):
1414 from .mixins import _LoopBoundMixin
15+ else :
16+ _LoopBoundMixin = object
1517
1618if sys .version_info >= (3 , 11 ):
1719 __all__ = ("Lock" , "Event" , "Condition" , "Semaphore" , "BoundedSemaphore" , "Barrier" )
4446 self , exc_type : type [BaseException ] | None , exc : BaseException | None , tb : TracebackType | None
4547 ) -> None : ...
4648
47- class Lock (_ContextManagerMixin ):
49+ class Lock (_ContextManagerMixin , _LoopBoundMixin ):
4850 if sys .version_info >= (3 , 10 ):
4951 def __init__ (self ) -> None : ...
5052 else :
@@ -54,7 +56,7 @@ class Lock(_ContextManagerMixin):
5456 async def acquire (self ) -> Literal [True ]: ...
5557 def release (self ) -> None : ...
5658
57- class Event :
59+ class Event ( _LoopBoundMixin ) :
5860 if sys .version_info >= (3 , 10 ):
5961 def __init__ (self ) -> None : ...
6062 else :
@@ -65,7 +67,7 @@ class Event:
6567 def clear (self ) -> None : ...
6668 async def wait (self ) -> Literal [True ]: ...
6769
68- class Condition (_ContextManagerMixin ):
70+ class Condition (_ContextManagerMixin , _LoopBoundMixin ):
6971 if sys .version_info >= (3 , 10 ):
7072 def __init__ (self , lock : Lock | None = None ) -> None : ...
7173 else :
@@ -79,7 +81,7 @@ class Condition(_ContextManagerMixin):
7981 def notify (self , n : int = 1 ) -> None : ...
8082 def notify_all (self ) -> None : ...
8183
82- class Semaphore (_ContextManagerMixin ):
84+ class Semaphore (_ContextManagerMixin , _LoopBoundMixin ):
8385 _value : int
8486 _waiters : deque [Future [Any ]]
8587 if sys .version_info >= (3 , 10 ):
0 commit comments