Make Stream accept a daemon option.
authorMarco Montagna <marcojoemontagna@gmail.com>
Wed, 7 Nov 2018 06:16:27 +0000 (22:16 -0800)
committerMarco Montagna <marcojoemontagna@gmail.com>
Sat, 1 Dec 2018 05:33:38 +0000 (21:33 -0800)
tweepy/streaming.py

index 68d3f866c8c9515e09a833cb1f410a866a24f039..7cd355d6c1679d7ab7875355f768e38598b7b96d 100644 (file)
@@ -195,6 +195,7 @@ class Stream(object):
         self.auth = auth
         self.listener = listener
         self.running = False
+        self.daemon = options.get("daemon", False)
         self.timeout = options.get("timeout", 300.0)
         self.retry_count = options.get("retry_count")
         # values according to
@@ -364,7 +365,7 @@ class Stream(object):
         self.running = True
         if is_async:
             self._thread = Thread(target=self._run)
-            self._thread.daemon = True
+            self._thread.daemon = self.daemon
             self._thread.start()
         else:
             self._run()