Default proxy to None for API initialization
authorHarmon <Harmon758@gmail.com>
Tue, 6 Apr 2021 18:07:08 +0000 (13:07 -0500)
committerHarmon <Harmon758@gmail.com>
Tue, 6 Apr 2021 18:10:48 +0000 (13:10 -0500)
tweepy/api.py

index 1a52d8a05efc36ec0209d839899863c90360b979..a6652fa2379841c376c5d14e7e6b8e612d7edf3f 100644 (file)
@@ -74,16 +74,18 @@ class API:
     """
 
     def __init__(self, auth_handler=None, *, cache=None,
-                 host='api.twitter.com', parser=ModelParser(), proxy='',
+                 host='api.twitter.com', parser=ModelParser(), proxy=None,
                  retry_count=0, retry_delay=0, retry_errors=None, timeout=60,
                  upload_host='upload.twitter.com', wait_on_rate_limit=False):
         self.auth = auth_handler
         self.cache = cache
         self.host = host
         self.parser = parser
+
         self.proxy = {}
-        if proxy:
+        if proxy is not None:
             self.proxy['https'] = proxy
+
         self.retry_count = retry_count
         self.retry_delay = retry_delay
         self.retry_errors = retry_errors