Skip to content

Commit 9944968

Browse files
committed
Set start method explicitly to "forkserver" so it works on MacOS (and if the
defaults change elsewhere in the future)
1 parent 33f9956 commit 9944968

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Lib/test/_test_multiprocessing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6815,7 +6815,7 @@ def test_std_streams_flushed_after_preload(self):
68156815
f.write('''if 1:
68166816
import sys
68176817
print('stdout', file=sys.stdout)
6818-
print('stderr', file=sys.stderr)''')
6818+
print('stderr', file=sys.stderr)\n''')
68196819

68206820
name = os.path.join(os.path.dirname(__file__), 'mp_preload_flush.py')
68216821
env = {'PYTHONPATH': self._temp_dir}

Lib/test/mp_preload_flush.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
if __name__ == '__main__':
55
assert 'a' not in sys.modules
6+
multiprocessing.set_start_method('forkserver')
67
multiprocessing.set_forkserver_preload(['a'])
78
for _ in range(2):
89
p = multiprocessing.Process()

0 commit comments

Comments
 (0)