Catch sooner if gevent is not installed.

This commit is contained in:
Louis Vézina 2019-02-12 07:19:48 -05:00
parent 7f563449c8
commit 1cdec28202
1 changed files with 4 additions and 1 deletions

View File

@ -5,9 +5,12 @@ bazarr_version = '0.7.2'
# Try to import gevent and exit if it's not available. This one is required to use websocket. # Try to import gevent and exit if it's not available. This one is required to use websocket.
try: try:
from gevent import monkey from gevent import monkey
except ImportError as e: except ImportError:
import logging
logging.exception('BAZARR require gevent Python module to be installed using pip.') logging.exception('BAZARR require gevent Python module to be installed using pip.')
try: try:
import os
from get_args import args
stop_file = open(os.path.join(args.config_dir, "bazarr.stop"), "w") stop_file = open(os.path.join(args.config_dir, "bazarr.stop"), "w")
except Exception as e: except Exception as e:
logging.error('BAZARR Cannot create bazarr.stop file.') logging.error('BAZARR Cannot create bazarr.stop file.')