Skip to content

Commit

Permalink
Fix compatibility with Python 3.10, refs aio-libs#358
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Oct 8, 2021
1 parent d7970f8 commit 9e13d3f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Expand Up @@ -43,7 +43,7 @@ jobs:
needs: lint
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
os: [ubuntu]
fail-fast:
false
Expand Down
2 changes: 2 additions & 0 deletions janus/__init__.py
Expand Up @@ -36,6 +36,8 @@ def __init__(self, maxsize: int = 0) -> None:
self._all_tasks_done = threading.Condition(self._sync_mutex)

self._async_mutex = asyncio.Lock()
# Workaround for Python 3.10 bug, see #358:
getattr(self._async_mutex, '_get_loop', lambda: None)()
self._async_not_empty = asyncio.Condition(self._async_mutex)
self._async_not_full = asyncio.Condition(self._async_mutex)
self._finished = asyncio.Event()
Expand Down

0 comments on commit 9e13d3f

Please sign in to comment.