[Python-Dev] Re: [Python-checkins] python/dist/src/Lib subprocess.py, NONE, 1.1

Thomas Heller theller at python.net
Wed Oct 13 09:41:45 CEST 2004


effbot at users.sourceforge.net writes:

> Update of /cvsroot/python/python/dist/src/Lib
> In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24287/Lib
>
> Added Files:
> 	subprocess.py 
> Log Message:
> Added Peter Astrand's subprocess module.

I suggest to remove the imports of the pywin32 stuff, it's not needed
and confuses tools like freeze or py2exe.

if mswindows:
    import threading
    import msvcrt
    try:
        from _subprocess import *
        class STARTUPINFO:
            dwFlags = 0
            hStdInput = None
            hStdOutput = None
            hStdError = None
        class pywintypes:
            error = IOError
    except ImportError:
        import pywintypes
        from win32api import GetStdHandle, STD_INPUT_HANDLE, \
                             STD_OUTPUT_HANDLE, STD_ERROR_HANDLE
        from win32api import GetCurrentProcess, DuplicateHandle, \
                             GetModuleFileName, GetVersion
        from win32con import DUPLICATE_SAME_ACCESS
        from win32pipe import CreatePipe
        from win32process import CreateProcess, STARTUPINFO, \
                                 GetExitCodeProcess, STARTF_USESTDHANDLES, \
                                 CREATE_NEW_CONSOLE
        from win32event import WaitForSingleObject, INFINITE, WAIT_OBJECT_0



More information about the Python-Dev mailing list