Skip to content

Commit 567c479

Browse files
authored
Merge branch 'fix/routines' into master
2 parents 77ef79d + e887639 commit 567c479

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

twitchio/ext/routines/__init__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,12 @@ def __init__(
6464
self,
6565
*,
6666
coro: Callable,
67-
loop: Optional[asyncio.AbstractEventLoop] = None,
6867
iterations: Optional[int] = None,
6968
time: Optional[datetime.datetime] = None,
7069
delta: Optional[float] = None,
7170
wait_first: Optional[bool] = False,
7271
):
7372
self._coro = coro
74-
self._loop = loop or asyncio.get_event_loop()
7573
self._task: asyncio.Task = None # type: ignore
7674

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

107105
copy = Routine(
108106
coro=self._coro,
109-
loop=self._loop,
110107
iterations=self._iterations,
111108
time=self._time,
112109
delta=self._delta,
@@ -149,7 +146,7 @@ def start(self, *args, **kwargs) -> asyncio.Task:
149146
self._args, self._kwargs = args, kwargs
150147

151148
self._restarting = False
152-
self._task = self._loop.create_task(self._routine(*args, **kwargs))
149+
self._task = asyncio.create_task(self._routine(*args, **kwargs))
153150

154151
if not self._error:
155152
self._error = self.on_error

0 commit comments

Comments
 (0)