From: Harmon Date: Sat, 23 Jan 2021 20:23:48 +0000 (-0600) Subject: Return thread when using threaded Stream.filter and Stream.sample X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=2e957b654ed54f7d7c2b92166517f4d15deee240;p=tweepy.git Return thread when using threaded Stream.filter and Stream.sample --- diff --git a/tweepy/streaming.py b/tweepy/streaming.py index ece9fe2..0d5e74c 100644 --- a/tweepy/streaming.py +++ b/tweepy/streaming.py @@ -230,6 +230,7 @@ class Stream: self.thread = Thread(target=self._connect, name="Tweepy Stream", args=args, kwargs=kwargs, daemon=self.daemon) self.thread.start() + return self.thread def filter(self, *, follow=None, track=None, locations=None, filter_level=None, languages=None, stall_warnings=False, @@ -257,7 +258,7 @@ class Stream: body['stall_warnings'] = stall_warnings if threaded: - self._threaded_connect(endpoint, body=body) + return self._threaded_connect(endpoint, body=body) else: self._connect(endpoint, body=body) @@ -274,7 +275,7 @@ class Stream: params['stall_warnings'] = 'true' if threaded: - self._threaded_connect(endpoint, params=params) + return self._threaded_connect(endpoint, params=params) else: self._connect(endpoint, params=params)