From 99ae5bf996fb6aac951459ef81127174d863c380 Mon Sep 17 00:00:00 2001 From: lededev Date: Fri, 22 Oct 2021 16:50:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=89=E7=A7=8D=E8=B0=83=E7=94=A8=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E4=BF=9D=E6=8C=81=E4=B8=80=E8=87=B4=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WebCrawler/storyline.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/WebCrawler/storyline.py b/WebCrawler/storyline.py index 9b0a44c..cc14a3f 100644 --- a/WebCrawler/storyline.py +++ b/WebCrawler/storyline.py @@ -16,7 +16,7 @@ G_mode_txt = ('顺序执行','线程池','进程池') class noThread(object): def map(self, fn, param): - return builtins.map(fn, param) + return list(builtins.map(fn, param)) def __enter__(self): return self def __exit__(self, exc_type, exc_val, exc_tb): @@ -47,7 +47,6 @@ def getStoryline(number, title, sites: list=None): 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: result = pool.map(getStoryline_mp, mp_args) - result = list(result) if run_mode == 0 else result if not debug and conf.storyline_show() == 0: for value in result: if isinstance(value, str) and len(value):