From c88e3ab17ee0672236794735ea28793a467fd130 Mon Sep 17 00:00:00 2001 From: Tiara Rodney Date: Sat, 2 Apr 2022 19:51:05 +0200 Subject: [PATCH] fix: catch standalone command exception gevent will not be installed by default, therefore print a message explaining required steps --- src/httpaste/__main__.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/httpaste/__main__.py b/src/httpaste/__main__.py index 4a6aae4..f019a95 100644 --- a/src/httpaste/__main__.py +++ b/src/httpaste/__main__.py @@ -30,7 +30,14 @@ def command_standalone(**kwargs): """ from httpaste import load_config, get_flask_app - from gevent.pywsgi import WSGIServer + + try: + from gevent.pywsgi import WSGIServer + except ImportError as e: + raise ImportError(' '.join(( + 'gevent is currently not installed.', + 'Please install it by running \'python3 -m pip install gevent\'.' + ))) from e config, server_config = load_config(kwargs.get('config_path'))