From: Namwoo Kim Date: Mon, 30 Mar 2015 01:38:24 +0000 (+0900) Subject: Clean up codes (remove print, whitespaces, deprecated function) X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=b7b865f4651b9c8fe4e9e2bb6376c8f62e944b18;p=tweepy.git Clean up codes (remove print, whitespaces, deprecated function) --- diff --git a/tweepy/api.py b/tweepy/api.py index 4744275..84f019d 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -182,7 +182,7 @@ class API(object): post_data = {} if media_ids is not None: post_data["media_ids"] = list_to_csv(media_ids) - + return bind_api( api=self, path='/statuses/update.json', diff --git a/tweepy/auth.py b/tweepy/auth.py index b15434b..c157ad8 100644 --- a/tweepy/auth.py +++ b/tweepy/auth.py @@ -85,7 +85,6 @@ class OAuthHandler(AuthHandler): self.request_token = self._get_request_token(access_type=access_type) return self.oauth.authorization_url(url) except Exception as e: - raise raise TweepError(e) def get_access_token(self, verifier=None): @@ -124,7 +123,6 @@ class OAuthHandler(AuthHandler): 'x_auth_username': username, 'x_auth_password': password}) - print(r.content) credentials = parse_qs(r.content) return credentials.get('oauth_token')[0], credentials.get('oauth_token_secret')[0] except Exception as e: diff --git a/tweepy/parsers.py b/tweepy/parsers.py index bccb032..869fc62 100644 --- a/tweepy/parsers.py +++ b/tweepy/parsers.py @@ -64,7 +64,7 @@ class JSONParser(Parser): def parse_error(self, payload): error = self.json_lib.loads(payload) - if error.has_key('error'): + if 'error' in error: return error['error'] else: return error['errors']