From: Harmon Date: Sat, 23 Jan 2021 19:53:26 +0000 (-0600) Subject: Improve order and formatting in Stream.sample X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=252aa2b2bd125a5479612507ab6ce1239e18d3ea;p=tweepy.git Improve order and formatting in Stream.sample --- diff --git a/tweepy/streaming.py b/tweepy/streaming.py index 5dfd05e..3cd9e4c 100644 --- a/tweepy/streaming.py +++ b/tweepy/streaming.py @@ -259,10 +259,12 @@ class Stream: self._connect(endpoint, body=body) def sample(self, threaded=False, languages=None, stall_warnings=False): - params = {} if self.running: raise TweepError('Stream object already connected!') + endpoint = 'statuses/sample' + + params = {} if languages: params['language'] = ','.join(map(str, languages)) if stall_warnings: