File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -254,7 +254,7 @@ def add_dateutil():
254
254
if sys .version_info [0 ] >= 3 :
255
255
import multiprocessing
256
256
from distutils import util
257
- def parallel_refactor (x ):
257
+ def refactor (x ):
258
258
from lib2to3 .refactor import RefactoringTool , get_fixers_from_package
259
259
class DistutilsRefactoringTool (RefactoringTool ):
260
260
def ignore (self , msg , * args , ** kw ):
@@ -270,8 +270,12 @@ def run_2to3(self, files):
270
270
# We need to skip certain files that have already been
271
271
# converted to Python 3.x
272
272
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 )
275
279
276
280
print_raw ("pymods %s" % py_modules )
277
281
print_raw ("packages %s" % packages )
You can’t perform that action at this time.
0 commit comments