fix: catch standalone command exception

gevent will not be installed by default, therefore print a message
explaining required steps
This commit is contained in:
Tiara Rodney 2022-04-02 19:51:05 +02:00
parent b3273ee9e2
commit 678935bd0e

View file

@ -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'))