From 4c388c412ea7f8b619e7caca274dbf8fe8bdd519 Mon Sep 17 00:00:00 2001 From: WizzyGeek <51919967+WizzyGeek@users.noreply.github.com> Date: Mon, 22 Nov 2021 15:35:49 +0530 Subject: [PATCH] =?UTF-8?q?[=F0=9F=94=A8]=20Fix=20bug=20in=20sync=20rateli?= =?UTF-8?q?mit=20decorator?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 2 +- uprate/_sync.py | 6 ++++++ uprate/_utils.py | 2 +- uprate/decorators.py | 3 ++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 0db76bc..a840b36 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] name = "uprate" -version = "0.2.0" +version = "0.2.1" description = "Ratelimits. Dumbified. A fully typed, simple ratelimit library." authors = ["WizzyGeek "] license = "MIT" diff --git a/uprate/_sync.py b/uprate/_sync.py index 51dd52d..ba2cd9b 100644 --- a/uprate/_sync.py +++ b/uprate/_sync.py @@ -15,6 +15,12 @@ from .rate import Rate, RateGroup from .store import H, MemoryStore, T +__all__ = ( + "SyncStore", + "SyncMemoryStore", + "SyncRateLimit" +) + G = TypeVar("G") if TYPE_CHECKING: diff --git a/uprate/_utils.py b/uprate/_utils.py index 5c6527a..1f5d2bc 100644 --- a/uprate/_utils.py +++ b/uprate/_utils.py @@ -6,7 +6,7 @@ R = TypeVar("R") __all__ = ( - "maybe_awaitable" + "maybe_awaitable", ) async def maybe_awaitable(ret: Union[R, Awaitable[R]]) -> R: diff --git a/uprate/decorators.py b/uprate/decorators.py index 8808480..a73ba40 100644 --- a/uprate/decorators.py +++ b/uprate/decorators.py @@ -138,10 +138,11 @@ def rated(*args, **kwargs): if on_retry is None: raise err from None else: - on_retry() + on_retry(err) else: return func() return _apply_attrs(rated, limit=limit) return decorator +