From a98a075bd855cd0c1e8f54284c42593a0be936a0 Mon Sep 17 00:00:00 2001 From: Michael Lazar Date: Wed, 7 Jun 2017 22:59:44 -0400 Subject: [PATCH] Catch the exception if curses cant be imported --- rtv/__main__.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/rtv/__main__.py b/rtv/__main__.py index 6c92123..449eca8 100644 --- a/rtv/__main__.py +++ b/rtv/__main__.py @@ -11,6 +11,18 @@ import warnings import six import requests +# Need to check for curses comparability before performing the rtv imports +try: + import curses +except ImportError: + if sys.platform == 'win32': + sys.exit('Fatal Error: This program is not compatible with Windows ' + 'Operating Systems.\nPlease try installing on either Linux ' + 'or Mac OS') + else: + sys.exit('Fatal Error: Your python distribution appears to be missing ' + '_curses.so.\nWas it compiled without support for curses?') + from . import docs from . import packages from .packages import praw