build: replace Pool with ThreadPool to avoid pickle issues (#88335) #549

Merged
tnoel merged 1 commits from wip/88335-setup-use-threadpool-to-avoid-pickle into main 2024-03-19 16:50:14 +01:00
1 changed files with 3 additions and 3 deletions

View File

@ -9,7 +9,7 @@ from distutils.command.build import build as _build
from distutils.command.sdist import sdist
from distutils.errors import CompileError
from distutils.spawn import find_executable
from multiprocessing import Pool
from multiprocessing.pool import ThreadPool
from setuptools import find_packages, setup
from setuptools.command.install_lib import install_lib as _install_lib
@ -140,7 +140,7 @@ class compile_scss(Command):
for css_filename in get_css_files():
yield ['sassc', '--sourcemap', css_filename.replace('.css', '.scss'), css_filename]
with Pool() as pool:
with ThreadPool() as pool:
for result in pool.imap_unordered(subprocess_run, get_build_commands()):
if not result:
raise CompileError('error compiling css')
@ -189,7 +189,7 @@ class build_icons(Command):
]
)
with Pool() as pool:
with ThreadPool() as pool:
for result in pool.imap_unordered(subprocess_run, cmds):
if not result:
raise CompileError('error building icons')