Handle requests.ReadTimeout in Stream
authorHarmon <Harmon758@gmail.com>
Tue, 5 Jan 2021 08:15:29 +0000 (02:15 -0600)
committerHarmon <Harmon758@gmail.com>
Tue, 5 Jan 2021 08:15:29 +0000 (02:15 -0600)
Resolves #750

tweepy/streaming.py

index 3283e9c0cebca97b1bb0915b28b0433d03ab5881..0db1a9ddd34864036d37b1282aeb2eb7938c6f52 100644 (file)
@@ -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