]> git.madduck.net Git - etc/vim.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Fix multiprocessing support for Windows binary (#632)
authorPeter Stensmyr <peter.stensmyr@gmail.com>
Fri, 14 Dec 2018 15:01:50 +0000 (02:01 +1100)
committerZsolt Dollenstein <zsol.zsol@gmail.com>
Fri, 14 Dec 2018 15:01:50 +0000 (15:01 +0000)
* 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.

black.py
blackd.py

index c1cc08021f313fe7fdec00c75bdccf53b2d24f0c..8855c37ca28e51c1de6df487bfc5ca87323c61b0 100644 (file)
--- a/black.py
+++ b/black.py
@@ -8,7 +8,7 @@ import io
 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()
 
index c5aa29cdec07e2e92374b7275c0713b488949a44..1a3b3690bc3b38b41b034eadf41cb271c203d185 100644 (file)
--- a/blackd.py
+++ b/blackd.py
@@ -2,6 +2,7 @@ import asyncio
 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()