From 13dd590b498fc066241032646eaca73f94ab68fa Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Thu, 24 Nov 2016 22:15:11 +0800 Subject: [PATCH] Update api.py `words` is a list containing separated words. Thus, it should not be passed into `is_url()` as a string. --- twitter/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/twitter/api.py b/twitter/api.py index 4de7f376..2ca730f4 100644 --- a/twitter/api.py +++ b/twitter/api.py @@ -1435,7 +1435,7 @@ def _TweetTextWrap(self, line_length = 0 words = re.split(r'\s', status) - if len(words) == 1 and not is_url(words): + if len(words) == 1 and not is_url(words[0]): if len(words[0]) > 140: raise TwitterError({"message": "Unable to split status into tweetable parts. Word was: {0}/{1}".format(len(words[0]), char_lim)}) else: