Pass daemon directly when initializing Thread in Stream
authorHarmon <Harmon758@gmail.com>
Fri, 22 Jan 2021 18:53:12 +0000 (12:53 -0600)
committerHarmon <Harmon758@gmail.com>
Fri, 22 Jan 2021 18:53:12 +0000 (12:53 -0600)
tweepy/streaming.py

index 405f9844976fc01ecc1b0ac99c4a9f562b0e5b79..71a0a68172c73e43ac2ef1f5f453e2419e9d0c21 100644 (file)
@@ -240,8 +240,8 @@ class Stream:
     def _start(self, threaded=False, *args, **kwargs):
         self.running = True
         if threaded:
-            self._thread = Thread(target=self._run, args=args, kwargs=kwargs)
-            self._thread.daemon = self.daemon
+            self._thread = Thread(target=self._run, args=args, kwargs=kwargs,
+                                  daemon=self.daemon)
             self._thread.start()
         else:
             self._run(*args, **kwargs)