From a2c79cfd6a3f8a398b1dc88f1471423f1e0af7ca Mon Sep 17 00:00:00 2001 From: Ryan Luu Date: Mon, 2 Dec 2024 12:06:53 -0800 Subject: [PATCH] Shorten import check --- src/instawebhooks/__main__.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/instawebhooks/__main__.py b/src/instawebhooks/__main__.py index 56474dc..86c8e6a 100644 --- a/src/instawebhooks/__main__.py +++ b/src/instawebhooks/__main__.py @@ -13,22 +13,11 @@ try: from aiohttp import ClientSession -except ModuleNotFoundError as exc: - raise SystemExit("Aiohttp not found.\n pip install [--user] aiohttp") from exc - -try: from discord import Embed, File, SyncWebhook -except ModuleNotFoundError as exc: - raise SystemExit( - "Discord.py not found.\n pip install [--user] discord.py" - ) from exc - -try: from instaloader import Instaloader, LoginRequiredException, Post, Profile except ModuleNotFoundError as exc: raise SystemExit( - "Instaloader not found.\n pip install [--user] instaloader" - ) from exc + exc.name + " not found.\n pip install [--user] " + exc.name) from exc def regex(pattern: str):