diff -r 4aab4e0cd759 Doc/library/compileall.rst --- a/Doc/library/compileall.rst Sun Apr 19 21:13:00 2015 +0300 +++ b/Doc/library/compileall.rst Sun Apr 19 23:09:35 2015 +0300 @@ -142,7 +142,7 @@ The argument *workers* specifies how many workers are used to compile files in parallel. The default is to not use multiple workers. If the platform can't use multiple workers and *workers* argument is given, - then a :exc:`NotImplementedError` will be raised. + then sequential compilation will be used as a fallback. If *workers* is lower than ``0``, a :exc:`ValueError` will be raised. .. versionchanged:: 3.2 diff -r 4aab4e0cd759 Lib/compileall.py --- a/Lib/compileall.py Sun Apr 19 21:13:00 2015 +0300 +++ b/Lib/compileall.py Sun Apr 19 23:09:35 2015 +0300 @@ -69,11 +69,9 @@ files = _walk_dir(dir, quiet=quiet, maxlevels=maxlevels, ddir=ddir) success = 1 - if workers is not None and workers != 1: + if workers is not None and workers != 1 and ProcessPoolExecutor: if workers < 0: raise ValueError('workers must be greater or equal to 0') - if ProcessPoolExecutor is None: - raise NotImplementedError('multiprocessing support not available') workers = workers or None with ProcessPoolExecutor(max_workers=workers) as executor: diff -r 4aab4e0cd759 Lib/test/test_compileall.py --- a/Lib/test/test_compileall.py Sun Apr 19 21:13:00 2015 +0300 +++ b/Lib/test/test_compileall.py Sun Apr 19 23:09:35 2015 +0300 @@ -136,10 +136,10 @@ self.assertTrue(compile_file_mock.called) @mock.patch('compileall.ProcessPoolExecutor', new=None) - def test_compile_missing_multiprocessing(self): - with self.assertRaisesRegex(NotImplementedError, - "multiprocessing support not available"): - compileall.compile_dir(self.directory, quiet=True, workers=5) + @mock.patch('compileall.compile_file') + def test_compile_missing_multiprocessing(self, compile_file_mock): + compileall.compile_dir(self.directory, quiet=True, workers=5) + self.assertTrue(compile_file_mock.called) class EncodingTest(unittest.TestCase): """Issue 6716: compileall should escape source code when printing errors