Fix multiprocessing support for Windows binary (#632)
* Fix multiprocessing support for Windows binary The black and blackd binaries generated for Windows builds would fail on reformatting multiple files due to a Windows-specific multiprocessing issue. Fix by calling freeze_support() as described in Python docs.
This commit is contained in:
parent
0b40a7badf
commit
fe24a15b84
3
black.py
3
black.py
@ -8,7 +8,7 @@
|
||||
import itertools
|
||||
import keyword
|
||||
import logging
|
||||
from multiprocessing import Manager
|
||||
from multiprocessing import Manager, freeze_support
|
||||
import os
|
||||
from pathlib import Path
|
||||
import pickle
|
||||
@ -3658,6 +3658,7 @@ def patch_click() -> None:
|
||||
|
||||
|
||||
def patched_main() -> None:
|
||||
freeze_support()
|
||||
patch_click()
|
||||
main()
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
from concurrent.futures import Executor, ProcessPoolExecutor
|
||||
from functools import partial
|
||||
import logging
|
||||
from multiprocessing import freeze_support
|
||||
|
||||
from aiohttp import web
|
||||
import aiohttp_cors
|
||||
@ -130,6 +131,7 @@ async def handle(request: web.Request, executor: Executor) -> web.Response:
|
||||
|
||||
|
||||
def patched_main() -> None:
|
||||
freeze_support()
|
||||
black.patch_click()
|
||||
main()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user