From 6c2834fd510ed83b4b2f8ba0ee1147e6317aff81 Mon Sep 17 00:00:00 2001 From: Harmon Date: Sat, 23 Jan 2021 13:32:09 -0600 Subject: [PATCH] Improve Stream initialization order and formatting --- tweepy/streaming.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tweepy/streaming.py b/tweepy/streaming.py index fe4871b..e1af932 100644 --- a/tweepy/streaming.py +++ b/tweepy/streaming.py @@ -127,9 +127,6 @@ class Stream: self.access_token = access_token self.access_token_secret = access_token_secret self.listener = listener - self.running = False - self.daemon = options.get("daemon", False) - self.max_retries = options.get("max_retries", inf) # The default socket.read size. Default to less than half the size of # a tweet so that it reads tweets with the minimal latency of 2 reads @@ -137,16 +134,19 @@ class Stream: # for more data to arrive but may also increase throughput by doing # fewer socket read calls. self.chunk_size = options.get("chunk_size", 512) - - self.verify = options.get("verify", True) - - self.session = None + self.daemon = options.get("daemon", False) + self.max_retries = options.get("max_retries", inf) self.proxies = {} proxy = options.get("proxy") if proxy: self.proxies["https"] = proxy + self.verify = options.get("verify", True) + + self.running = False + self.session = None + def _run(self, endpoint, params=None, body=None): if self.session is None: self.session = requests.Session() -- 2.25.1