From 97df3db10b4032d63299e3ad57eb0826b1409ac0 Mon Sep 17 00:00:00 2001 From: "Osmay Y. Cruz Alvarez" Date: Wed, 24 Oct 2018 13:28:05 +0300 Subject: [PATCH] remove harcoded api url This is needed for mocking the streaming Twitter API. --- tweepy/streaming.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tweepy/streaming.py b/tweepy/streaming.py index 309124e..45c0084 100644 --- a/tweepy/streaming.py +++ b/tweepy/streaming.py @@ -189,8 +189,6 @@ class ReadBuffer(object): class Stream(object): - host = 'stream.twitter.com' - def __init__(self, auth, listener, **options): self.auth = auth self.listener = listener @@ -223,6 +221,7 @@ class Stream(object): # Example: proxies = {'http': 'http://localhost:1080', 'https': 'http://localhost:1080'} self.proxies = options.get("proxies") + self.host = options.get('host', 'stream.twitter.com') def new_session(self): self.session = requests.Session() @@ -451,7 +450,6 @@ class Stream(object): if filter_level: self.body['filter_level'] = filter_level.encode(encoding) self.session.params = {'delimited': 'length'} - self.host = 'stream.twitter.com' self._start(is_async) def sitestream(self, follow, stall_warnings=False, -- 2.25.1