From 26b2bfea7434aeb9d3687397341e0e7ad3f4edfc Mon Sep 17 00:00:00 2001 From: Cody Logan Date: Thu, 30 Nov 2023 10:11:21 -0800 Subject: Have functions return an exit code instead of calling sys.exit --- src/wikiget/dl.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/wikiget/dl.py') diff --git a/src/wikiget/dl.py b/src/wikiget/dl.py index 85c6685..5a6ef0b 100644 --- a/src/wikiget/dl.py +++ b/src/wikiget/dl.py @@ -20,7 +20,6 @@ from __future__ import annotations import logging -import sys from concurrent.futures import ThreadPoolExecutor from typing import TYPE_CHECKING @@ -134,7 +133,7 @@ def batch_download(args: Namespace) -> int: dl_dict = read_batch_file(args.FILE) except OSError as e: logger.error("File could not be read: %s", str(e)) - sys.exit(1) + return 1 with ThreadPoolExecutor(max_workers=args.threads) as executor: futures = [] -- cgit v1.2.3