From b6a8f666a2e0e58a6df5394c07f117a88542eaaa Mon Sep 17 00:00:00 2001 From: Harmon Date: Sat, 23 Jan 2021 14:21:04 -0600 Subject: [PATCH] Optimize Stream.filter --- tweepy/streaming.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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: -- 2.25.1