Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamsorcerer committed Sep 17, 2022
1 parent 1987d6c commit d061620
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
5 changes: 1 addition & 4 deletions aiojobs/_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ class Job:
_task = None

def __init__(self, coro, scheduler):
if sys.version_info >= (3, 7):
self._loop = loop = asyncio.get_running_loop()
else:
self._loop = loop = asyncio.get_event_loop()
self._loop = loop = asyncio.get_running_loop()
self._coro = coro
self._scheduler = scheduler
self._started = loop.create_future()
Expand Down
6 changes: 1 addition & 5 deletions aiojobs/_scheduler.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import asyncio
import sys
from collections.abc import Collection

from ._job import Job


class Scheduler(Collection):
def __init__(self, *, close_timeout, limit, pending_limit, exception_handler):
if sys.version_info >= (3, 7):
self._loop = loop = asyncio.get_running_loop()
else:
self._loop = loop = asyncio.get_event_loop()
self._loop = loop = asyncio.get_running_loop()
self._jobs = set()
self._close_timeout = close_timeout
self._limit = limit
Expand Down
1 change: 0 additions & 1 deletion tests/test_scheduler.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import asyncio
import sys
from unittest import mock

import pytest
Expand Down

0 comments on commit d061620

Please sign in to comment.