From 3381dda884b888cf139380ffcb2bd7e5d49ecdba Mon Sep 17 00:00:00 2001 From: James Lu Date: Tue, 19 Jul 2016 17:44:22 -0700 Subject: [PATCH] Throw specific errors for missing ircmatch/setuptools libraries --- classes.py | 5 ++++- setup.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/classes.py b/classes.py index 15ea2e5..6056f8a 100644 --- a/classes.py +++ b/classes.py @@ -16,7 +16,10 @@ import hashlib from copy import deepcopy import inspect -import ircmatch +try: + import ircmatch +except ImportError: + raise ImportError("Please install the ircmatch library and try again.") from . import world, utils, structures, __version__ from .log import * diff --git a/setup.py b/setup.py index 6bc7665..9ed3176 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,9 @@ """Setup module for PyLink IRC Services.""" -from setuptools import setup, find_packages +try: + from setuptools import setup, find_packages +except ImportError: + raise ImportError("Please install Setuptools and try again.") from codecs import open import subprocess from os import path