From 5da134986a674ac5d498207eacd1063cf69f4544 Mon Sep 17 00:00:00 2001 From: lededev Date: Tue, 19 Oct 2021 00:17:45 +0800 Subject: [PATCH] storyline.py: bug fix --- WebCrawler/storyline.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/WebCrawler/storyline.py b/WebCrawler/storyline.py index d9da869..693f404 100644 --- a/WebCrawler/storyline.py +++ b/WebCrawler/storyline.py @@ -31,6 +31,8 @@ def getStoryline(number, title): apply_sites = [ s for s in storyine_sites if s in G_registered_storyline_site] mp_args = ((site, number, title, debug) for site in apply_sites) cores = min(len(apply_sites), os.cpu_count()) + if cores == 0: + return '' run_mode = conf.storyline_mode() assert run_mode in (0,1,2) with ThreadPool(cores) if run_mode == 1 else Pool(cores) if run_mode == 2 else noThread() as pool: