From f9e2a23dde5c316a56bdcb3b038cb1cbff39b12f Mon Sep 17 00:00:00 2001 From: NextChai <75498301+NextChai@users.noreply.github.com> Date: Sat, 30 Apr 2022 02:26:06 -0400 Subject: [PATCH] Fix missing type in exceptions --- Github/exceptions.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Github/exceptions.py b/Github/exceptions.py index 8b0f20d..2e07202 100644 --- a/Github/exceptions.py +++ b/Github/exceptions.py @@ -1,6 +1,11 @@ #== exceptions.py ==# import datetime +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from aiohttp import ClientRequest + __all__ = ( 'APIError', 'HTTPException', @@ -50,9 +55,9 @@ 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, count): + def __init__(self, response: ClientRequest, count: int): msg = 'Performing this action will exceed the ratelimit, aborting.\n{} remaining available calls, calls to make: {}.' - msg = msg.format(response.header['X-RateLimit-Remaining'], count) + msg = msg.format(response.headers['X-RateLimit-Remaining'], count) super().__init__(msg) class NoAuthProvided(ClientException):