From: Harmon Date: Tue, 2 Feb 2021 17:06:57 +0000 (-0600) Subject: Replace APIMethod.allowed_param with build_parameters method parameter X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=a1165d9206818adb0f56c55bc9c79992624d9d60;p=tweepy.git Replace APIMethod.allowed_param with build_parameters method parameter Replace APIMethod.allowed_param with APIMethod.build_parameters parameter --- 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!')