Clean up codes (remove print, whitespaces, deprecated function)
authorNamwoo Kim <iam@kimtree.net>
Mon, 30 Mar 2015 01:38:24 +0000 (10:38 +0900)
committerNamwoo Kim <iam@kimtree.net>
Wed, 22 Apr 2015 01:26:02 +0000 (10:26 +0900)
tweepy/api.py
tweepy/auth.py
tweepy/parsers.py

index 4744275829945ed6e0e52f1befe5b3d091d4cc2a..84f019dc4a4a892bd53265aea84e5ca4959302ed 100644 (file)
@@ -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',
index b15434bcdbbb65b0962d103336209efd0927bdc4..c157ad8fd03bb66975dc384d3c92e6ea90789ea1 100644 (file)
@@ -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:
index bccb0322c5257b64ad978d4e1fb1cd0584a63fcb..869fc6230be0bec601b7d4a8aa2c06f9893cad35 100644 (file)
@@ -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']