On Windows, when you call pool.map, under the hood python will *again* import whatever the main module is. In this case it's dotest.py. Importing dotest then causes all of its code to run again, and since the main execution of dotest was not protected by if name == "main", it would recursively kick off the entire process all over again.
Okay I see, makes sense. Particularly the discrepancy.
That code will get much nicer (in dotest.py) when that gets some energy put into cleaning it up.
Thanks for tracking it down, Zachary!
This patch works for me.
Although I thought we could put less code in main() function.
if name == "main":
But that will require some more work to refactor the code. Probably that could wait for Todd's clean up.
I tried that at first, but unfortunately in order to do that you have to
write a line like
for every global accessed by main. Like you said, Todd can probably clean
that up, for now I just wanted to get something working.
Yep, let's wait on that. There is a metric ton of code that needs to shift around in there, be broken down into bite-sized chunks of functionality, etc. We'll get it cleaned up with a main() function soon enough when we do some of that decomposition.