summaryrefslogtreecommitdiffstats
path: root/Lib/test/mp_fork_bomb.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/mp_fork_bomb.py')
-rw-r--r--Lib/test/mp_fork_bomb.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/mp_fork_bomb.py b/Lib/test/mp_fork_bomb.py
index 908afe3..017e010 100644
--- a/Lib/test/mp_fork_bomb.py
+++ b/Lib/test/mp_fork_bomb.py
@@ -7,6 +7,11 @@ def foo():
# correctly on Windows. However, we should get a RuntimeError rather
# than the Windows equivalent of a fork bomb.
+if len(sys.argv) > 1:
+ multiprocessing.set_start_method(sys.argv[1])
+else:
+ multiprocessing.set_start_method('spawn')
+
p = multiprocessing.Process(target=foo)
p.start()
p.join()