From a1165d9206818adb0f56c55bc9c79992624d9d60 Mon Sep 17 00:00:00 2001 From: Harmon Date: Tue, 2 Feb 2021 11:06:57 -0600 Subject: [PATCH] Replace APIMethod.allowed_param with build_parameters method parameter Replace APIMethod.allowed_param with APIMethod.build_parameters parameter --- tweepy/binder.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tweepy/binder.py b/tweepy/binder.py index 7e2a8a7..81c8177 100644 --- a/tweepy/binder.py +++ b/tweepy/binder.py @@ -19,23 +19,24 @@ class APIMethod: def __init__(self, *args, **kwargs): self.api = api = kwargs.pop('api') - self.allowed_param = kwargs.pop('allowed_param', []) self.session = requests.Session() self.parser = kwargs.pop('parser', api.parser) - self.build_parameters(args, kwargs) + + allowed_param = kwargs.pop('allowed_param', []) + self.build_parameters(allowed_param, args, kwargs) # Monitoring rate limits self._remaining_calls = None self._reset_time = None - def build_parameters(self, args, kwargs): + def build_parameters(self, allowed_param, args, kwargs): self.session.params = {} for idx, arg in enumerate(args): if arg is None: continue try: - self.session.params[self.allowed_param[idx]] = str(arg) + self.session.params[allowed_param[idx]] = str(arg) except IndexError: raise TweepError('Too many parameters supplied!') -- 2.25.1