From b0b232297f55cd38db85bb2ec5b30a6022a3f4d1 Mon Sep 17 00:00:00 2001 From: Harmon Date: Sun, 16 May 2021 06:06:15 -0500 Subject: [PATCH] Check oauthlib installation when importing asynchronous subpackage --- tweepy/asynchronous/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tweepy/asynchronous/__init__.py b/tweepy/asynchronous/__init__.py index aac29bb..72ff5c6 100644 --- a/tweepy/asynchronous/__init__.py +++ b/tweepy/asynchronous/__init__.py @@ -10,8 +10,11 @@ Asynchronous interfaces with the Twitter API try: import aiohttp + import oauthlib except ModuleNotFoundError: from tweepy.errors import TweepyException - raise TweepyException("tweepy.asynchronous requires aiohttp to be installed") + raise TweepyException( + "tweepy.asynchronous requires aiohttp and oauthlib to be installed" + ) from tweepy.asynchronous.streaming import AsyncStream -- 2.25.1