"Fredrik Lundh" <fredrik@pythonware.com> writes:
Thomas Heller wrote:
To be honest, I'm against code in the core that depends on whether pywin32 is installed or not.
does py2exe support "if 0" blocks?
py2exe uses modulefinder to scan the byte code of compiled modules, and Python doesn't generate code for 'if 0' blocks, so, yes.
just one more question: is there a specific problem with win32all? if this is a general problem, how do you deal with other optional modules in the standard library (e.g. _xmlrpclib) ?
If _xmlrpclib is installed, py2exe will find it if the script uses xmlrpclib. I guess that is what the user expects. If _xmlrpclib is not installed, py2exe will warn that it is missing (this warning is probably not very useful, and it seems Bob has supressed this warning in py2app). The point with win32all (now pywin32) is that most windows users will have it installed, for good reasons. py2exe will find it, and include it if the subprocess module is pulled in - whether _subprocess is available or not. But subprocess, the Python 2.4 version, will *never* use it, because _subprocess is always available (isn't this now even a builtin module, in python24.dll?). Hope that answers your question, Thomas