Simplify requests imports in streaming.py
authorHarmon <Harmon758@gmail.com>
Tue, 5 Jan 2021 08:08:37 +0000 (02:08 -0600)
committerHarmon <Harmon758@gmail.com>
Tue, 5 Jan 2021 08:08:37 +0000 (02:08 -0600)
tweepy/streaming.py

index bcd73313027e612400e96923d0995cc8ab7ca767..3283e9c0cebca97b1bb0915b28b0433d03ab5881 100644 (file)
@@ -12,7 +12,6 @@ from threading import Thread
 from time import sleep
 
 import requests
-from requests.exceptions import Timeout
 
 from tweepy.api import API
 from tweepy.error import TweepError
@@ -248,7 +247,7 @@ class Stream:
                         self.snooze_time = self.snooze_time_step
                         self.listener.on_connect()
                         self._read_loop(resp)
-                except (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