From 438391b4cc82a4c28cdff092d90dfd4e0775e36e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Botond=20D=C3=A9nes?= Date: Fri, 28 May 2021 11:01:38 +0300 Subject: [PATCH] scripts/coverage.py: check that --path is a directory To detect a bad --path that would fail coverage generation early. --- scripts/coverage.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/coverage.py b/scripts/coverage.py index abb2c7313a..0ce8825151 100755 --- a/scripts/coverage.py +++ b/scripts/coverage.py @@ -234,6 +234,9 @@ def main(argv): args = arg_parser.parse_args(argv_head) + if not os.path.isdir(args.path): + arg_parser.exit(2, f"Error: invalid value for `--path`: path '{args.path}' doesn't exists or is not a directory\n") + if args.run: run(argv_tail, args.executable, args.distinct_id) if args.name.is_default: