Skip to content

Commit

Permalink
Add support for Python 3.12 (#19)
Browse files Browse the repository at this point in the history
We need to avoid the call to wait_closed - the semantics changed in
Python 3.12 and it breaks mock_device as-is.
  • Loading branch information
cottsay committed Dec 14, 2023
1 parent 0e2c984 commit 1118a27
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
python: ['3.9', '3.10', '3.11']
python: ['3.9', '3.10', '3.11', '3.12']
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
Expand Down
5 changes: 3 additions & 2 deletions test/mock_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,10 @@ def client_connected(
return asyncio.wait_for(task, None)

server = await asyncio.start_server(client_connected, host='127.0.0.1')
async with server:
try:
yield server.sockets[0].getsockname()
await server.wait_closed()
finally:
server.close()
if not connections:
return

Expand Down

0 comments on commit 1118a27

Please sign in to comment.