Remove StreamListener.api
authorHarmon <Harmon758@gmail.com>
Sun, 24 Jan 2021 13:38:15 +0000 (07:38 -0600)
committerHarmon <Harmon758@gmail.com>
Sun, 24 Jan 2021 13:38:15 +0000 (07:38 -0600)
tweepy/streaming.py

index a0007452d2c17c76fe615eb78232a5e6abadbff4..48dd2c8a11ecff89961d9746ad9ad2bdb59a4ab4 100644 (file)
@@ -15,7 +15,6 @@ import requests
 from requests_oauthlib import OAuth1
 import urllib3
 
-from tweepy.api import API
 from tweepy.error import TweepError
 from tweepy.models import Status
 
@@ -24,9 +23,6 @@ log = logging.getLogger(__name__)
 
 class StreamListener:
 
-    def __init__(self, api=None):
-        self.api = api or API()
-
     def on_connect(self):
         """Called once connected to streaming server.
 
@@ -62,7 +58,7 @@ class StreamListener:
         data = json.loads(raw_data)
 
         if 'in_reply_to_status_id' in data:
-            status = Status.parse(self.api, data)
+            status = Status.parse(None, data)
             return self.on_status(status)
         if 'delete' in data:
             delete = data['delete']['status']