I was working the following example from Doug Hellmann tutorial on multiprocessing:
import multiprocessing def worker(): \"\"\"worker function\"\"\"
I don't know about multiprocessing, but I suspect that it spawns child processes that have a different __name__ global. By removing the test, you are making every child start the spawning process again.
multiprocessing
__name__