From c8b95ba138b72d08d737b01ea519332192b2ee9f Mon Sep 17 00:00:00 2001 From: Harmon Date: Sun, 27 Dec 2020 16:53:30 -0600 Subject: [PATCH] Replace type equality check in OAuthHandler initialization With isinstance usage --- tweepy/auth.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tweepy/auth.py b/tweepy/auth.py index 7e82b40..3cd7efa 100644 --- a/tweepy/auth.py +++ b/tweepy/auth.py @@ -36,10 +36,10 @@ class OAuthHandler(AuthHandler): OAUTH_ROOT = '/oauth/' def __init__(self, consumer_key, consumer_secret, callback=None): - if type(consumer_key) == str: + if isinstance(consumer_key, str): consumer_key = consumer_key.encode('ascii') - if type(consumer_secret) == str: + if isinstance(consumer_secret, str): consumer_secret = consumer_secret.encode('ascii') self.consumer_key = consumer_key -- 2.25.1