Skip to content

Commit

Permalink
Restore compatibility with Python < 3.9.
Browse files Browse the repository at this point in the history
Fix #951.
  • Loading branch information
aaugustin committed May 13, 2021
1 parent 217ac2d commit 70fadbf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ They may change at any time.

*In development*

9.0.2
.....

*In development*

* Restored compatibility of ``python -m websockets`` with Python < 3.9.

9.0.1
.....

Expand Down
4 changes: 2 additions & 2 deletions src/websockets/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,11 @@ def main() -> None:

# Due to zealous removal of the loop parameter in the Queue constructor,
# we need a factory coroutine to run in the freshly created event loop.
async def queue_factory() -> asyncio.Queue[str]:
async def queue_factory() -> "asyncio.Queue[str]":
return asyncio.Queue()

# Create a queue of user inputs. There's no need to limit its size.
inputs: asyncio.Queue[str] = loop.run_until_complete(queue_factory())
inputs: "asyncio.Queue[str]" = loop.run_until_complete(queue_factory())

# Create a stop condition when receiving SIGINT or SIGTERM.
stop: asyncio.Future[None] = loop.create_future()
Expand Down

0 comments on commit 70fadbf

Please sign in to comment.