From 6488286a0585246e615570fbf2dc2d6c6833fecb Mon Sep 17 00:00:00 2001 From: NextChai <75498301+NextChai@users.noreply.github.com> Date: Sat, 30 Apr 2022 02:39:44 -0400 Subject: [PATCH] Fix response type in WillExceedRatelimit --- Github/exceptions.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Github/exceptions.py b/Github/exceptions.py index 948eca7..7aff10b 100644 --- a/Github/exceptions.py +++ b/Github/exceptions.py @@ -1,10 +1,8 @@ # == exceptions.py ==# import datetime -from typing import TYPE_CHECKING -if TYPE_CHECKING: - from aiohttp import ClientRequest +from aiohttp import ClientResponse __all__ = ( 'APIError', @@ -69,7 +67,7 @@ class Ratelimited(APIError): class WillExceedRatelimit(APIError): """Raised when the library predicts the call will exceed the ratelimit, will abort the call by default.""" - def __init__(self, response: ClientRequest, count: int): + def __init__(self, response: ClientResponse, count: int): msg = 'Performing this action will exceed the ratelimit, aborting.\n{} remaining available calls, calls to make: {}.' msg = msg.format(response.headers['X-RateLimit-Remaining'], count) super().__init__(msg)