diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..92a8191 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,9 @@ +[build-system] +requires = ["setuptools>=42", "wheel"] +build-backend = "setuptools.build_meta" + +[tool.poetry] +name = "ratelimiter" +version = "1.2.0" +description = "A rate-limiting library" +authors = ["Frazer McLean "] diff --git a/ratelimiter/_async.py b/ratelimiter/_async.py index feb80ad..e8ad367 100644 --- a/ratelimiter/_async.py +++ b/ratelimiter/_async.py @@ -32,4 +32,5 @@ async def __aenter__(self): await asyncio.sleep(sleeptime) return self - __aexit__ = asyncio.coroutine(RateLimiter.__exit__) + # backward behavior for python 3.5 - 3.10; no need for decorator if deprecated in python > 3.11 + __aexit__ = asyncio.coroutine(RateLimiter.__exit__) if hasattr(asyncio, 'coroutine') else RateLimiter.__exit__