Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: 68707af1fb87c8b3d128b71c863cd68195da198f authored by Georg Brandl on 23 February 2014, 07:46:00 UTC
merge
Tip revision: 68707af
mp_fork_bomb.py
import multiprocessing, sys

def foo():
    print("123")

# Because "if __name__ == '__main__'" is missing this will not work
# correctly on Windows.  However, we should get a RuntimeError rather
# than the Windows equivalent of a fork bomb.

p = multiprocessing.Process(target=foo)
p.start()
p.join()
sys.exit(p.exitcode)
back to top