From 4d864ab2220b1c3eea516bbe215948d923a7e936 Mon Sep 17 00:00:00 2001 From: Harmon Date: Tue, 5 Jan 2021 02:15:29 -0600 Subject: [PATCH] Handle requests.ReadTimeout in Stream Resolves #750 --- tweepy/streaming.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tweepy/streaming.py b/tweepy/streaming.py index 3283e9c..0db1a9d 100644 --- a/tweepy/streaming.py +++ b/tweepy/streaming.py @@ -247,7 +247,8 @@ class Stream: self.snooze_time = self.snooze_time_step self.listener.on_connect() self._read_loop(resp) - except (requests.Timeout, ssl.SSLError) as exc: + except (requests.ReadTimeout, requests.Timeout, + ssl.SSLError) as exc: # This is still necessary, as a SSLError can actually be # thrown when using Requests # If it's not time out treat it like any other exception -- 2.25.1