File tree Expand file tree Collapse file tree
codecov_cli/services/staticanalysis Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55from functools import partial
66from multiprocessing import get_context
77from pathlib import Path
8+ import sys
89
910import click
1011import httpx
@@ -183,11 +184,15 @@ async def process_files(
183184 all_data = {}
184185 file_metadata = []
185186 errors = {}
187+ if sys .platform .startswith ("win32" ) or sys .platform .startswith ("darwin" ):
188+ pool_thread_method = "spawn"
189+ else :
190+ pool_thread_method = "fork"
186191 with click .progressbar (
187192 length = len (files_to_analyze ),
188193 label = "Analyzing files" ,
189194 ) as bar :
190- with get_context ("fork" ).Pool (processes = numberprocesses ) as pool :
195+ with get_context (pool_thread_method ).Pool (processes = numberprocesses ) as pool :
191196 file_results = pool .imap_unordered (mapped_func , files_to_analyze )
192197 for result in file_results :
193198 bar .update (1 , result )
You can’t perform that action at this time.
0 commit comments