@@ -602,18 +602,25 @@ class AbstractEventLoop:
602602 @abstractmethod
603603 async def shutdown_default_executor (self ) -> None : ...
604604
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).
617624 if sys .version_info >= (3 , 12 ):
618625 @abstractmethod
619626 @deprecated ("Deprecated since Python 3.12; removed in Python 3.14." )
@@ -627,7 +634,6 @@ class _AbstractEventLoopPolicy:
627634 @abstractmethod
628635 def set_child_watcher (self , watcher : AbstractChildWatcher ) -> None : ...
629636
630- if sys .version_info < (3 , 14 ):
631637 AbstractEventLoopPolicy = _AbstractEventLoopPolicy
632638
633639if sys .version_info >= (3 , 14 ):
0 commit comments