From: Harmon Date: Sat, 23 Jan 2021 20:21:04 +0000 (-0600) Subject: Optimize Stream.filter X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=b6a8f666a2e0e58a6df5394c07f117a88542eaaa;p=tweepy.git Optimize Stream.filter --- diff --git a/tweepy/streaming.py b/tweepy/streaming.py index 4274794..ece9fe2 100644 --- a/tweepy/streaming.py +++ b/tweepy/streaming.py @@ -245,10 +245,10 @@ class Stream: if track: body['track'] = ','.join(track) if locations and len(locations) > 0: - if len(locations) % 4 != 0: + if len(locations) % 4: raise TweepError("Wrong number of locations points, " "it has to be a multiple of 4") - body['locations'] = ','.join([f'{l:.4f}' for l in locations]) + body['locations'] = ','.join(f'{l:.4f}' for l in locations) if filter_level: body['filter_level'] = filter_level if languages: