[issue10845] test_multiprocessing failure under Windows

Antoine Pitrou report at bugs.python.org
Sat Jan 29 14:14:51 CET 2011


Antoine Pitrou <pitrou at free.fr> added the comment:

Nick, a more problematic issue is that __main__ is always called __main__, regardless of whether it is actually imported as the real "main module" or through a regular import. This means that it is impossible to discriminate between both uses by using "if __name__ == '__main__'", which in turn means that top-level code will always get executed as a side-effect of importing, which means the "__main__.py" feature is completely broken for use with multiprocessing under Windows!

This also shows, IMO, how uselessly complicated and misleading the import system has become.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10845>
_______________________________________


More information about the Python-bugs-list mailing list