Skip to content

Commit

Permalink
Add back loop close and test on Windows/Trio
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrochart committed Nov 12, 2024
1 parent c1dd759 commit 76d23fa
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
1 change: 1 addition & 0 deletions src/anyio/_backends/_selector_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ def _close_selector_and_loop() -> None:
asyncio_loop.close = loop_close # type: ignore[method-assign]
_selectors.pop(asyncio_loop, None)
selector_thread.close()
asyncio_loop.close()

asyncio_loop.close = _close_selector_and_loop # type: ignore[method-assign]

Expand Down
3 changes: 0 additions & 3 deletions tests/test_sockets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1853,9 +1853,6 @@ async def test_connect_tcp_getaddrinfo_context() -> None:


async def test_wait_socket_readable(anyio_backend_name: str) -> None:
if anyio_backend_name == "trio" and platform.system() == "Windows":
pytest.skip("Internal error in Trio")

def client(port: int) -> None:
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
sock.connect(("127.0.0.1", port))
Expand Down

0 comments on commit 76d23fa

Please sign in to comment.