Skip to content

Commit

Permalink
fix: Fix Python 3.8 type error (#3615)
Browse files Browse the repository at this point in the history
* fix: Fix Python 3.8 type error

Fixes #3614

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add release file

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Patrick Arminio <[email protected]>
  • Loading branch information
3 people authored Sep 3, 2024
1 parent 54b8a49 commit 50baec9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Release type: patch

This release fixes a TypeError on Python 3.8 due to us using a
`asyncio.Queue[Tuple[bool, Any]](1)` instead of `asyncio.Queue(1)`.
2 changes: 1 addition & 1 deletion strawberry/http/async_base_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def _stream_with_heartbeat(
self, stream: Callable[[], AsyncGenerator[str, None]]
) -> Callable[[], AsyncGenerator[str, None]]:
"""Adds a heartbeat to the stream, to prevent the connection from closing when there are no messages being sent."""
queue = asyncio.Queue[Tuple[bool, Any]](1)
queue: asyncio.Queue[Tuple[bool, Any]] = asyncio.Queue(1)

cancelling = False

Expand Down

0 comments on commit 50baec9

Please sign in to comment.