Skip to content
This repository was archived by the owner on Aug 7, 2024. It is now read-only.

Commit 9b097e0

Browse files
committed
fix lint
1 parent cec7aa5 commit 9b097e0

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

twitter/api.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,9 @@
3737
try:
3838
# python 3
3939
from urllib.parse import urlparse, urlunparse, urlencode, quote_plus
40-
from urllib.request import urlopen
4140
from urllib.request import __version__ as urllib_version
4241
except ImportError:
4342
from urlparse import urlparse, urlunparse
44-
from urllib2 import urlopen
4543
from urllib import urlencode, quote_plus
4644
from urllib import __version__ as urllib_version
4745

@@ -1445,14 +1443,14 @@ def _TweetTextWrap(self,
14451443

14461444
if len(words) == 1 and not is_url(words[0]):
14471445
if len(words[0]) > CHARACTER_LIMIT:
1448-
raise TwitterError({"message": "Unable to split status into tweetable parts. Word was: {0}/{1}".format(len(words[0]), char_lim)})
1446+
raise TwitterError("Unable to split status into tweetable parts. Word was: {0}/{1}".format(len(words[0]), char_lim))
14491447
else:
14501448
tweets.append(words[0])
14511449
return tweets
14521450

14531451
for word in words:
14541452
if len(word) > char_lim:
1455-
raise TwitterError({"message": "Unable to split status into tweetable parts. Word was: {0}/{1}".format(len(word), char_lim)})
1453+
raise TwitterError("Unable to split status into tweetable parts. Word was: {0}/{1}".format(len(word), char_lim))
14561454
new_len = line_length
14571455

14581456
if is_url(word):
@@ -1569,8 +1567,13 @@ def GetUserRetweets(self,
15691567
Returns:
15701568
A sequence of twitter.Status instances, one for each message up to count
15711569
"""
1572-
return self.GetUserTimeline(since_id=since_id, count=count, max_id=max_id, trim_user=trim_user,
1573-
exclude_replies=True, include_rts=True)
1570+
return self.GetUserTimeline(
1571+
since_id=since_id,
1572+
count=count,
1573+
max_id=max_id,
1574+
trim_user=trim_user,
1575+
exclude_replies=True,
1576+
include_rts=True)
15741577

15751578
def GetReplies(self,
15761579
since_id=None,
@@ -4808,10 +4811,10 @@ def _BuildUrl(self, url, path_elements=None, extra_params=None):
48084811
# Add any additional path elements to the path
48094812
if path_elements:
48104813
# Filter out the path elements that have a value of None
4811-
p = [i for i in path_elements if i]
4814+
filtered_elements = [i for i in path_elements if i]
48124815
if not path.endswith('/'):
48134816
path += '/'
4814-
path += '/'.join(p)
4817+
path += '/'.join(filtered_elements)
48154818

48164819
# Add any additional query parameters to the query string
48174820
if extra_params and len(extra_params) > 0:

0 commit comments

Comments
 (0)