diff --git a/aiojobs/_job.py b/aiojobs/_job.py index 411755d..63a9c8e 100644 --- a/aiojobs/_job.py +++ b/aiojobs/_job.py @@ -44,7 +44,7 @@ def closed(self): return self._closed async def _do_wait(self, timeout): - with async_timeout.timeout(timeout=timeout, loop=self._loop): + async with async_timeout.timeout(timeout): # TODO: add a test for waiting for a pending coro await self._started return await self._task @@ -84,8 +84,7 @@ async def _close(self, timeout): # self._scheduler is None after _done_callback() scheduler = self._scheduler try: - with async_timeout.timeout(timeout=timeout, - loop=self._loop): + async with async_timeout.timeout(timeout): await self._task except asyncio.CancelledError: pass diff --git a/pyproject.toml b/pyproject.toml index ce20dbc..93e5857 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,9 @@ module = "aiojobs" author = "Andrew Svetlov" author-email = "andrew.svetlov@gmail.com" home-page = "https://github.com/aio-libs/aiojobs" -requires=[] +requires=[ + "async-timeout >= 4" +] requires-python=">=3.5" description-file="README.rst" classifiers = [