Skip to content

Commit

Permalink
Merge branch 'fix/routines' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
EvieePy authored Nov 12, 2024
2 parents 77ef79d + e887639 commit 567c479
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions twitchio/ext/routines/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,12 @@ def __init__(
self,
*,
coro: Callable,
loop: Optional[asyncio.AbstractEventLoop] = None,
iterations: Optional[int] = None,
time: Optional[datetime.datetime] = None,
delta: Optional[float] = None,
wait_first: Optional[bool] = False,
):
self._coro = coro
self._loop = loop or asyncio.get_event_loop()
self._task: asyncio.Task = None # type: ignore

self._time = time
Expand Down Expand Up @@ -106,7 +104,6 @@ def __get__(self, instance, owner):

copy = Routine(
coro=self._coro,
loop=self._loop,
iterations=self._iterations,
time=self._time,
delta=self._delta,
Expand Down Expand Up @@ -149,7 +146,7 @@ def start(self, *args, **kwargs) -> asyncio.Task:
self._args, self._kwargs = args, kwargs

self._restarting = False
self._task = self._loop.create_task(self._routine(*args, **kwargs))
self._task = asyncio.create_task(self._routine(*args, **kwargs))

if not self._error:
self._error = self.on_error
Expand Down

0 comments on commit 567c479

Please sign in to comment.