Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Update events and windows_events for asyncio in 3.14 #14128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
May 25, 2025
Prev Previous commit
Next Next commit
Fixing stubtest issues
  • Loading branch information
sobolevn committed May 24, 2025
commit 33ae2dc1120b64fded6f078ddd725aded234f795
3 changes: 0 additions & 3 deletions 3 stdlib/@tests/stubtest_allowlists/py314.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ _imp.pyc_magic_number_token
_thread.RLock.locked
_thread.set_name
asyncio.__all__
asyncio._AbstractEventLoopPolicy
asyncio._get_event_loop_policy
asyncio._set_event_loop_policy
asyncio.eager_task_factory
asyncio.tasks.eager_task_factory
builtins.bytearray.resize
Expand Down
8 changes: 0 additions & 8 deletions 8 stdlib/@tests/stubtest_allowlists/win32-py314.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@
# ====================================================================

_winapi.COPY_FILE_DIRECTORY
asyncio.WindowsProactorEventLoopPolicy.get_child_watcher
asyncio.WindowsProactorEventLoopPolicy.set_child_watcher
asyncio._WindowsProactorEventLoopPolicy
asyncio._WindowsSelectorEventLoopPolicy
asyncio.windows_events.WindowsProactorEventLoopPolicy
asyncio.windows_events.WindowsSelectorEventLoopPolicy
asyncio.windows_events._WindowsProactorEventLoopPolicy
asyncio.windows_events._WindowsSelectorEventLoopPolicy
compression.zlib.ZLIBNG_VERSION
ctypes.c_double_complex
ctypes.c_float_complex
Expand Down
27 changes: 21 additions & 6 deletions 27 stdlib/asyncio/events.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ if sys.version_info < (3, 14):
# Keep asyncio.__all__ updated with any changes to __all__ here
if sys.version_info >= (3, 14):
__all__ = (
"AbstractEventLoopPolicy",
"_AbstractEventLoopPolicy",
"AbstractEventLoop",
"AbstractServer",
"Handle",
"TimerHandle",
"_get_event_loop_policy",
"get_event_loop_policy",
"_set_event_loop_policy",
"set_event_loop_policy",
"get_event_loop",
"set_event_loop",
Expand Down Expand Up @@ -600,7 +602,7 @@ class AbstractEventLoop:
@abstractmethod
async def shutdown_default_executor(self) -> None: ...

class AbstractEventLoopPolicy:
class _AbstractEventLoopPolicy:
@abstractmethod
def get_event_loop(self) -> AbstractEventLoop: ...
@abstractmethod
Expand All @@ -622,20 +624,33 @@ class AbstractEventLoopPolicy:
@abstractmethod
def set_child_watcher(self, watcher: AbstractChildWatcher) -> None: ...

if sys.version_info < (3, 14):
AbstractEventLoopPolicy = _AbstractEventLoopPolicy

if sys.version_info >= (3, 14):
class _BaseDefaultEventLoopPolicy(AbstractEventLoopPolicy, metaclass=ABCMeta):
class _BaseDefaultEventLoopPolicy(_AbstractEventLoopPolicy, metaclass=ABCMeta):
def get_event_loop(self) -> AbstractEventLoop: ...
def set_event_loop(self, loop: AbstractEventLoop | None) -> None: ...
def new_event_loop(self) -> AbstractEventLoop: ...

else:
class BaseDefaultEventLoopPolicy(AbstractEventLoopPolicy, metaclass=ABCMeta):
class BaseDefaultEventLoopPolicy(_AbstractEventLoopPolicy, metaclass=ABCMeta):
def get_event_loop(self) -> AbstractEventLoop: ...
def set_event_loop(self, loop: AbstractEventLoop | None) -> None: ...
def new_event_loop(self) -> AbstractEventLoop: ...

def get_event_loop_policy() -> AbstractEventLoopPolicy: ...
def set_event_loop_policy(policy: AbstractEventLoopPolicy | None) -> None: ...
if sys.version_info >= (3, 14):
def _get_event_loop_policy() -> _AbstractEventLoopPolicy: ...
def _set_event_loop_policy(policy: _AbstractEventLoopPolicy | None) -> None: ...

@deprecated("Deprecated as of Python 3.14; will be removed in Python 3.16")
def get_event_loop_policy() -> _AbstractEventLoopPolicy: ...
@deprecated("Deprecated as of Python 3.14; will be removed in Python 3.16")
def set_event_loop_policy(policy: _AbstractEventLoopPolicy | None) -> None: ...
else:
def get_event_loop_policy() -> _AbstractEventLoopPolicy: ...
def set_event_loop_policy(policy: _AbstractEventLoopPolicy | None) -> None: ...

def set_event_loop(loop: AbstractEventLoop | None) -> None: ...
def new_event_loop() -> AbstractEventLoop: ...

Expand Down
2 changes: 0 additions & 2 deletions 2 stdlib/asyncio/windows_events.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@ if sys.platform == "win32":

class _WindowsProactorEventLoopPolicy(events._BaseDefaultEventLoopPolicy):
_loop_factory: ClassVar[type[ProactorEventLoop]]
def get_child_watcher(self) -> NoReturn: ...
def set_child_watcher(self, watcher: Any) -> NoReturn: ...

else:
class WindowsSelectorEventLoopPolicy(events.BaseDefaultEventLoopPolicy):
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.