Remove explicit handling of requests.ReadTimeout in Stream
authorHarmon <Harmon758@gmail.com>
Tue, 5 Jan 2021 08:54:51 +0000 (02:54 -0600)
committerHarmon <Harmon758@gmail.com>
Tue, 5 Jan 2021 08:54:51 +0000 (02:54 -0600)
requests.ReadTimeout subclasses requests.Timeout, so this shouldn't be necessary

tweepy/streaming.py

index 0db1a9ddd34864036d37b1282aeb2eb7938c6f52..3283e9c0cebca97b1bb0915b28b0433d03ab5881 100644 (file)
@@ -247,8 +247,7 @@ class Stream:
                         self.snooze_time = self.snooze_time_step
                         self.listener.on_connect()
                         self._read_loop(resp)
-                except (requests.ReadTimeout, requests.Timeout,
-                        ssl.SSLError) as exc:
+                except (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