tweepy.stream 给出 'None Type' 对象在 streaming.py 中没有属性 'on_exception'

tweepy.stream is giving 'None Type' object has no attribute 'on_exception' in streaming.py

我正在使用此函数从 Twitter 读取推文,但在 filter 中的第 6 行出现错误:

def sendData (c_socket):
    authorization = OAuthHandler(consumer_key, consumer_secret)
    authorization.set_access_token(access_token, access_secret)

    twitter_stream = Stream(authorization, Twitter(c_socket))
    twitter_stream.filter(languages=['en'], track=["#"])

如果没有完整的回溯,很难确定确切的问题,但无论 Twitter(c_socket) 是什么,它都可能返回 None 而不是 StreamListener