Skip to content

Commit

Permalink
I don't like how ruff changes this...
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeshardmind committed Jan 12, 2025
1 parent 354b93a commit 5e338d1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/async_utils/_nm_building_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ class _NMWaiter:
__slots__ = ("_future", "_val")

def __init__(self, val: int = 1, /) -> None:
self._future: cf.Future[None] = (
cf.Future()
) # This is why this is for internal use only
# This is why this is for internal use only
self._future: cf.Future[None] = cf.Future()
self._val = val

def __lt__(self, other: object) -> bool:
Expand All @@ -55,7 +54,8 @@ def __await__(self) -> Generator[t.Any, None, None]:
def wake(self) -> None:
if not self._future.done():
try:
self._future.set_result(None) # This is why this is for internal use only
# This is why this is for internal use only
self._future.set_result(None)
except cf.InvalidStateError:
# Race condition possible with multiple attempts to wake
# Racing in some cases is less expensive than locking in all
Expand Down

0 comments on commit 5e338d1

Please sign in to comment.