Skip to content
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

Resolve asyncio issues for 3.13 #12327

Merged
merged 11 commits into from
Jul 13, 2024

Conversation

max-muoto
Copy link
Contributor

@max-muoto max-muoto commented Jul 12, 2024

Account for new asyncio changes from 3.13:

  • abort_clients and close_client methods on AbstractServer.
  • New keep_alive param for AbstractEventLoop.create_server.
  • Minor helper tweaks.
  • Add new warnings argument for asyncio.Streams.StreamWriter.__del__
  • Add new QueueShutDown exception and shutdown method in ayncio.queues.
  • Add EventLoop to unix_events.pyi and windows_events.pyi.

@max-muoto max-muoto marked this pull request as ready for review July 12, 2024 01:57

This comment has been minimized.

Copy link
Collaborator

@srittau srittau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, just one small thing (and an optional small thing) below.

@@ -237,6 +243,7 @@ class BaseEventLoop(AbstractEventLoop):
ssl: _SSLContext = None,
reuse_address: bool | None = None,
reuse_port: bool | None = None,
keep_alive: bool | None = None,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird that the default is None, not False, but it is what it is ...

class QueueEmpty(Exception): ...
class QueueFull(Exception): ...

if sys.version_info >= (3, 13):
class QueueShutDown(Exception): ...
__all__ = ("Queue", "PriorityQueue", "LifoQueue", "QueueFull", "QueueEmpty", "QueueShutDown")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

__all__ should stay at the top of the file (below the imports), even if it means repeating the version_info branch.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed: bee3ed2

@@ -59,7 +62,19 @@ if sys.version_info < (3, 14):

if sys.platform != "win32":
if sys.version_info >= (3, 14):
__all__ = ("SelectorEventLoop", "DefaultEventLoopPolicy")
__all__ = ("SelectorEventLoop", "DefaultEventLoopPolicy", "EventLoop")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea why __all__ is down here, but you could also optionally move it to the top of the file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed: bee3ed2

Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@srittau srittau merged commit 670ca31 into python:main Jul 13, 2024
63 checks passed
max-muoto added a commit to max-muoto/typeshed that referenced this pull request Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants