From: Harmon Date: Fri, 22 Jan 2021 18:50:16 +0000 (-0600) Subject: Default Stream._start threaded parameter to False X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=901675f443503e7647e493e30e1c48ea2c580c42;p=tweepy.git Default Stream._start threaded parameter to False Pass threaded as kwarg to Stream._start in Stream.filter and Stream.sample --- diff --git a/tweepy/streaming.py b/tweepy/streaming.py index dcf7004..405f984 100644 --- a/tweepy/streaming.py +++ b/tweepy/streaming.py @@ -237,7 +237,7 @@ class Stream: if resp.raw.closed: self.on_closed(resp) - def _start(self, threaded, *args, **kwargs): + def _start(self, threaded=False, *args, **kwargs): self.running = True if threaded: self._thread = Thread(target=self._run, args=args, kwargs=kwargs) @@ -259,7 +259,7 @@ class Stream: self.session.params['language'] = ','.join(map(str, languages)) if stall_warnings: self.session.params['stall_warnings'] = 'true' - self._start(threaded) + self._start(threaded=threaded) def filter(self, follow=None, track=None, threaded=False, locations=None, stall_warnings=False, languages=None, encoding='utf8', filter_level=None): @@ -284,7 +284,7 @@ class Stream: if filter_level: body['filter_level'] = filter_level.encode(encoding) self.session.params = {} - self._start(threaded, body=body) + self._start(body=body, threaded=threaded) def disconnect(self): self.running = False