Rename StreamListener.on_timeout to on_connection_error
authorHarmon <Harmon758@gmail.com>
Tue, 19 Jan 2021 09:41:55 +0000 (03:41 -0600)
committerHarmon <Harmon758@gmail.com>
Tue, 19 Jan 2021 09:41:55 +0000 (03:41 -0600)
tweepy/streaming.py

index 66ac999a72c0559899633846547444c9bf75b8f6..7104000deaee9dbcbedf1c1429c5cf80aa38e163 100644 (file)
@@ -90,8 +90,8 @@ class StreamListener:
         """Called when a non-200 status code is returned"""
         return False
 
-    def on_timeout(self):
-        """Called when stream connection times out"""
+    def on_connection_error(self):
+        """Called when stream connection errors or times out"""
         return
 
     def on_disconnect(self, notice):
@@ -257,7 +257,7 @@ class Stream:
                     if isinstance(exc, ssl.SSLError):
                         if not (exc.args and 'timed out' in str(exc.args[0])):
                             raise
-                    if self.listener.on_timeout() is False:
+                    if self.listener.on_connection_error() is False:
                         break
                     if self.running is False:
                         break