mirror of https://github.com/zulip/zulip.git
markdown: Remove handler for old bug with incompatible twitter library.
See commit 8b002040e0
and #86. The
development environment bug that necessitated this handler has long
been irrelevant.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
b9fd49a2c6
commit
e513b75e86
|
@ -388,8 +388,9 @@ def fetch_tweet_data(tweet_id: str) -> Optional[Dict[str, Any]]:
|
||||||
# the startup performance of `manage.py` commands.
|
# the startup performance of `manage.py` commands.
|
||||||
import twitter
|
import twitter
|
||||||
|
|
||||||
try:
|
|
||||||
api = twitter.Api(tweet_mode='extended', **creds)
|
api = twitter.Api(tweet_mode='extended', **creds)
|
||||||
|
|
||||||
|
try:
|
||||||
# Sometimes Twitter hangs on responses. Timing out here
|
# Sometimes Twitter hangs on responses. Timing out here
|
||||||
# will cause the Tweet to go through as-is with no inline
|
# will cause the Tweet to go through as-is with no inline
|
||||||
# preview, rather than having the message be rejected
|
# preview, rather than having the message be rejected
|
||||||
|
@ -397,10 +398,6 @@ def fetch_tweet_data(tweet_id: str) -> Optional[Dict[str, Any]]:
|
||||||
# formatting timeout.
|
# formatting timeout.
|
||||||
tweet = timeout(3, api.GetStatus, tweet_id)
|
tweet = timeout(3, api.GetStatus, tweet_id)
|
||||||
res = tweet.AsDict()
|
res = tweet.AsDict()
|
||||||
except AttributeError:
|
|
||||||
markdown_logger.error('Unable to load twitter api, you may have the wrong '
|
|
||||||
'library installed, see https://github.com/zulip/zulip/issues/86')
|
|
||||||
return None
|
|
||||||
except TimeoutExpired:
|
except TimeoutExpired:
|
||||||
# We'd like to try again later and not cache the bad result,
|
# We'd like to try again later and not cache the bad result,
|
||||||
# so we need to re-raise the exception (just as though
|
# so we need to re-raise the exception (just as though
|
||||||
|
|
Loading…
Reference in New Issue