Skip to content

Commit

Permalink
[tasks] Fix typing for tasks.SleepHandle.future set calls
Browse files Browse the repository at this point in the history
  • Loading branch information
Sachaa-Thanasius committed Dec 10, 2023
1 parent 4d03fa1 commit 9b9c93a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions discord/ext/tasks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,12 @@ def __init__(self, dt: datetime.datetime, *, loop: asyncio.AbstractEventLoop) ->
self.loop: asyncio.AbstractEventLoop = loop
self.future: asyncio.Future[None] = loop.create_future()
relative_delta = discord.utils.compute_timedelta(dt)
self.handle = loop.call_later(relative_delta, self.future.set_result, True)
self.handle = loop.call_later(relative_delta, self.future.set_result, None)

def recalculate(self, dt: datetime.datetime) -> None:
self.handle.cancel()
relative_delta = discord.utils.compute_timedelta(dt)
self.handle: asyncio.TimerHandle = self.loop.call_later(relative_delta, self.future.set_result, True)
self.handle: asyncio.TimerHandle = self.loop.call_later(relative_delta, self.future.set_result, None)

def wait(self) -> asyncio.Future[Any]:
return self.future
Expand Down

0 comments on commit 9b9c93a

Please sign in to comment.