Change Stream._thread to thread
authorHarmon <Harmon758@gmail.com>
Sat, 23 Jan 2021 19:51:06 +0000 (13:51 -0600)
committerHarmon <Harmon758@gmail.com>
Sat, 23 Jan 2021 19:51:06 +0000 (13:51 -0600)
tweepy/streaming.py

index 716b1b77192a2e796cc2f1b2415721bd018a25d4..5dfd05e027d0bae3f27088c83e48b0fcd6d15e38 100644 (file)
@@ -141,6 +141,7 @@ class Stream:
 
         self.running = False
         self.session = None
+        self.thread = None
 
     def _connect(self, endpoint, params=None, body=None):
         self.running = True
@@ -226,9 +227,9 @@ class Stream:
             self.running = False
 
     def _threaded_connect(self, *args, **kwargs):
-        self._thread = Thread(target=self._connect, name="Tweepy Stream",
-                              args=args, kwargs=kwargs, daemon=self.daemon)
-        self._thread.start()
+        self.thread = Thread(target=self._connect, name="Tweepy Stream",
+                             args=args, kwargs=kwargs, daemon=self.daemon)
+        self.thread.start()
 
     def filter(self, follow=None, track=None, threaded=False, locations=None,
                stall_warnings=False, languages=None, filter_level=None):