From 971891cc23e6f1c78cb362de906a1cc11e8958c3 Mon Sep 17 00:00:00 2001 From: Harmon Date: Tue, 2 Feb 2021 11:41:14 -0600 Subject: [PATCH] Move APIMethod.build_parameters call from APIMethod.__init__ to bind_api --- tweepy/binder.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tweepy/binder.py b/tweepy/binder.py index 406272e..8a3cebb 100644 --- a/tweepy/binder.py +++ b/tweepy/binder.py @@ -17,12 +17,9 @@ log = logging.getLogger(__name__) class APIMethod: - def __init__(self, *args, **kwargs): + def __init__(self): self.session = requests.Session() - allowed_param = kwargs.pop('allowed_param', []) - self.build_parameters(allowed_param, args, kwargs) - # Monitoring rate limits self._remaining_calls = None self._reset_time = None @@ -194,7 +191,9 @@ def bind_api(*args, **kwargs): upload_api = kwargs.pop('upload_api', False) use_cache = kwargs.pop('use_cache', True) - method = APIMethod(*args, **kwargs) + method = APIMethod() + allowed_param = kwargs.pop('allowed_param', []) + method.build_parameters(allowed_param, args, kwargs) try: if kwargs.get('create'): return method -- 2.25.1