@@ -602,18 +602,25 @@ class AbstractEventLoop:
602
602
@abstractmethod
603
603
async def shutdown_default_executor (self ) -> None : ...
604
604
605
- # This class does not exist at runtime, but stubtest complains if it's marked as
606
- # @type_check_only because it has an alias that does exist at runtime. See mypy#19568.
607
- # @type_check_only
608
- class _AbstractEventLoopPolicy :
609
- @abstractmethod
610
- def get_event_loop (self ) -> AbstractEventLoop : ...
611
- @abstractmethod
612
- def set_event_loop (self , loop : AbstractEventLoop | None ) -> None : ...
613
- @abstractmethod
614
- def new_event_loop (self ) -> AbstractEventLoop : ...
615
- # Child processes handling (Unix only).
616
- if sys .version_info < (3 , 14 ):
605
+ if sys .version_info >= (3 , 14 ):
606
+ class _AbstractEventLoopPolicy :
607
+ @abstractmethod
608
+ def get_event_loop (self ) -> AbstractEventLoop : ...
609
+ @abstractmethod
610
+ def set_event_loop (self , loop : AbstractEventLoop | None ) -> None : ...
611
+ @abstractmethod
612
+ def new_event_loop (self ) -> AbstractEventLoop : ...
613
+
614
+ else :
615
+ @type_check_only
616
+ class _AbstractEventLoopPolicy :
617
+ @abstractmethod
618
+ def get_event_loop (self ) -> AbstractEventLoop : ...
619
+ @abstractmethod
620
+ def set_event_loop (self , loop : AbstractEventLoop | None ) -> None : ...
621
+ @abstractmethod
622
+ def new_event_loop (self ) -> AbstractEventLoop : ...
623
+ # Child processes handling (Unix only).
617
624
if sys .version_info >= (3 , 12 ):
618
625
@abstractmethod
619
626
@deprecated ("Deprecated since Python 3.12; removed in Python 3.14." )
@@ -627,7 +634,6 @@ class _AbstractEventLoopPolicy:
627
634
@abstractmethod
628
635
def set_child_watcher (self , watcher : AbstractChildWatcher ) -> None : ...
629
636
630
- if sys .version_info < (3 , 14 ):
631
637
AbstractEventLoopPolicy = _AbstractEventLoopPolicy
632
638
633
639
if sys .version_info >= (3 , 14 ):
0 commit comments