Issue #23917: Fall back to sequential compilation when ProcessPoolExecutor doesn't exist.

Patch by Claudiu Popa.
This commit is contained in:
Berker Peksag 2015-04-22 09:39:19 +03:00
parent c3a7f18100
commit d86ef05a02
4 changed files with 10 additions and 9 deletions

View file

@ -136,10 +136,10 @@ class CompileallTests(unittest.TestCase):
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