Skip to content

Commit

Permalink
simplify checkpointing
Browse files Browse the repository at this point in the history
  • Loading branch information
richardsheridan committed Mar 7, 2023
1 parent 10b933d commit 2e9d220
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions trio/_wait_for_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ async def WaitForSingleObject(obj):
OSError: If the handle is invalid, e.g. when it is already closed.
"""
await trio.lowlevel.checkpoint_if_cancelled()
# Allow ints or whatever we can convert to a win handle
handle = _handle(obj)

Expand All @@ -34,7 +33,7 @@ async def WaitForSingleObject(obj):
if retcode == ErrorCodes.WAIT_FAILED:
raise_winerror()
elif retcode != ErrorCodes.WAIT_TIMEOUT:
await trio.lowlevel.cancel_shielded_checkpoint()
await trio.lowlevel.checkpoint()
return

# Wait for a thread that waits for two handles: the handle plus a handle
Expand Down

0 comments on commit 2e9d220

Please sign in to comment.