From 1c161f9bbfb2c1b04c429701bbc794edf9809104 Mon Sep 17 00:00:00 2001 From: Harmon Date: Sat, 26 Dec 2020 04:36:33 -0600 Subject: [PATCH] Improve formatting in is_rate_limit_error_message function --- tweepy/error.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tweepy/error.py b/tweepy/error.py index b9a3bb8..7a548d3 100644 --- a/tweepy/error.py +++ b/tweepy/error.py @@ -20,10 +20,8 @@ class TweepError(Exception): def is_rate_limit_error_message(message): """Check if the supplied error message belongs to a rate limit error.""" - return isinstance(message, list) \ - and len(message) > 0 \ - and 'code' in message[0] \ - and message[0]['code'] == 88 + return (isinstance(message, list) and len(message) > 0 and + 'code' in message[0] and message[0]['code'] == 88) class RateLimitError(TweepError): -- 2.25.1