8000 don't use multiprocessing to convert files on win · matplotlib/matplotlib@9b0cfda · GitHub
[go: up one dir, main page]

Skip to content

Commit 9b0cfda

Browse files
committed
don't use multiprocessing to convert files on win
1 parent f4fee35 commit 9b0cfda

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

setup.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def add_dateutil():
254254
if sys.version_info[0] >= 3:
255255
import multiprocessing
256256
from distutils import util
257-
def parallel_refactor(x):
257+
def refactor(x):
258258
from lib2to3.refactor import RefactoringTool, get_fixers_from_package
259259
class DistutilsRefactoringTool(RefactoringTool):
260260
def ignore(self, msg, *args, **kw):
@@ -270,8 +270,12 @@ def run_2to3(self, files):
270270
# We need to skip certain files that have already been
271271
# converted to Python 3.x
272272
filtered = [x for x in files if 'py3' not in x]
273-
p = multiprocessing.Pool()
274-
p.map(parallel_refactor, filtered)
273+
if sys.platform.startswith('win'):
274+
# doing this in parallel on windows may crash your computer
275+
[refactor(f) for f in filtered]
276+
else:
277+
p = multiprocessing.Pool()
278+
p.map(refactor, filtered)
275279

276280
print_raw("pymods %s" % py_modules)
277281
print_raw("packages %s" % packages)

0 commit comments

Comments
 (0)
0