try:
import aiohttp
except ModuleNotFoundError:
- from tweepy.error import TweepError
- raise TweepError("tweepy.asynchronous requires aiohttp to be installed")
+ from tweepy.errors import TweepyException
+ raise TweepyException("tweepy.asynchronous requires aiohttp to be installed")
from tweepy.asynchronous.streaming import AsyncStream
from yarl import URL
import tweepy
-from tweepy.error import TweepError
+from tweepy.errors import TweepyException
from tweepy.models import Status
log = logging.getLogger(__name__)
Returns :class:`asyncio.Task`
"""
if self.task is not None and not self.task.done():
- raise TweepError("Stream is already connected")
+ raise TweepyException("Stream is already connected")
endpoint = "statuses/filter"
headers = {"Content-Type": "application/x-www-form-urlencoded"}
body["track"] = ','.join(map(str, track))
if locations is not None:
if len(locations) % 4:
- raise TweepError(
+ raise TweepyException(
"Number of location coordinates should be a multiple of 4"
)
body["locations"] = ','.join(
Returns :class:`asyncio.Task`
"""
if self.task is not None and not self.task.done():
- raise TweepError("Stream is already connected")
+ raise TweepyException("Stream is already connected")
endpoint = "statuses/sample"