From be3ec5c656b1f834cc1b551d1a820095045ccfd5 Mon Sep 17 00:00:00 2001 From: Alexander Shadchin Date: Wed, 3 Nov 2021 13:41:37 +0300 Subject: [PATCH] Switch on async-timeout > 4 --- aiojobs/_job.py | 5 ++--- pyproject.toml | 4 +++- 2 files changed, 5 insertions(+), 4 deletions(-) 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 = [