From 99e9cebdc38c6c0271148a6da70a1d74214f0e77 Mon Sep 17 00:00:00 2001 From: ping Date: Tue, 29 Mar 2016 10:44:04 +0800 Subject: [PATCH] Fix issue where is_quote_status is true but there is no quoted_status --- twython/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/twython/api.py b/twython/api.py index 2ed50bc2..1d514eb3 100644 --- a/twython/api.py +++ b/twython/api.py @@ -597,7 +597,7 @@ def html_for_tweet(tweet, use_display_url=True, use_expanded_url=False, expand_q text = text.replace(tweet['text'][start:end], url_html % (entity['url'], shown_url)) - if expand_quoted_status and tweet.get('is_quote_status'): + if expand_quoted_status and tweet.get('is_quote_status') and tweet.get('quoted_status'): quoted_status = tweet['quoted_status'] text += '
%(quote)s' \ '%(quote_user_name)s' \