error if --coverage but no coverage package

This commit is contained in:
meejah 2019-08-07 13:59:40 -06:00
parent 20e191a8b9
commit 358f0c9ead

View File

@ -202,14 +202,16 @@ def _setup_coverage(reactor):
"""
# can we put this _setup_coverage call after we hit
# argument-parsing?
if not '--coverage' in sys.argv:
if '--coverage' not in sys.argv:
return
sys.argv.remove('--coverage')
try:
import coverage
except ImportError:
return
except RuntimeError(
"The 'coveage' package must be installed to use --coverage"
)
# this doesn't change the shell's notion of the environment, but
# it makes the test in process_startup() succeed, which is the