Skip to content

Commit

Permalink
Patched read and write need to handle self argument
Browse files Browse the repository at this point in the history
  • Loading branch information
CoolCat467 committed Sep 29, 2024
1 parent 76538d8 commit 36ad522
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/trio/_tests/test_unix_pipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,11 @@ async def expect_closedresourceerror() -> None:

orig_wait_readable = _core._run.TheIOManager.wait_readable

async def patched_wait_readable(fd: int | _HasFileNo) -> None:
await orig_wait_readable(fd)
async def patched_wait_readable(
self: _core._run.TheIOManager,
fd: int | _HasFileNo,
) -> None:
await orig_wait_readable(self, fd)
await r.aclose()

monkeypatch.setattr(_core._run.TheIOManager, "wait_readable", patched_wait_readable)
Expand All @@ -228,8 +231,11 @@ async def expect_closedresourceerror() -> None:

orig_wait_writable = _core._run.TheIOManager.wait_writable

async def patched_wait_writable(fd: int | _HasFileNo) -> None:
await orig_wait_writable(fd)
async def patched_wait_writable(
self: _core._run.TheIOManager,
fd: int | _HasFileNo,
) -> None:
await orig_wait_writable(self, fd)
await s.aclose()

monkeypatch.setattr(_core._run.TheIOManager, "wait_writable", patched_wait_writable)
Expand Down

0 comments on commit 36ad522

Please sign in to comment.