Rollback to BaseTools revision 1799. The patch tries to use Win32 platform specific...
authorqhuang8 <qhuang8@c2973edb-eda0-4c78-bc6a-9341b269661f>
Tue, 2 Feb 2010 08:42:48 +0000 (08:42 +0000)
committerqhuang8 <qhuang8@c2973edb-eda0-4c78-bc6a-9341b269661f>
Tue, 2 Feb 2010 08:42:48 +0000 (08:42 +0000)
git-svn-id: https://edk2-buildtools.svn.sourceforge.net/svnroot/edk2-buildtools/trunk/BaseTools@1834 c2973edb-eda0-4c78-bc6a-9341b269661f

Source/Python/build/build.py

index 9148b8f..539fd77 100644 (file)
@@ -22,10 +22,6 @@ import glob
 import time\r
 import platform\r
 import traceback\r
 import time\r
 import platform\r
 import traceback\r
-import types\r
-if sys.platform == "win32":\r
-    import subprocess\r
-    from _subprocess import CreateProcess\r
 \r
 from threading import *\r
 from optparse import OptionParser\r
 \r
 from threading import *\r
 from optparse import OptionParser\r
@@ -217,43 +213,6 @@ def ReadMessage(From, To, ExitFlag):
         if ExitFlag.isSet():\r
             break\r
 \r
         if ExitFlag.isSet():\r
             break\r
 \r
-class WinPopen(Popen):\r
-    def _execute_child(self, args, executable, preexec_fn, close_fds,\r
-                       cwd, env, universal_newlines,\r
-                       startupinfo, creationflags, shell,\r
-                       p2cread, p2cwrite,\r
-                       c2pread, c2pwrite,\r
-                       errread, errwrite):\r
-        """Execute program (MS Windows version)"""\r
-\r
-        if not isinstance(args, types.StringTypes):\r
-            args = subprocess.list2cmdline(args)\r
-\r
-            # Start the process\r
-            try:\r
-                hp, ht, pid, tid = CreateProcess(executable, args,\r
-                                         None, None,\r
-                                         0,\r
-                                         creationflags,\r
-                                         env,\r
-                                         cwd,\r
-                                         None)\r
-            except IOError, e:\r
-                raise WindowsError(*e.args)\r
-\r
-            # Retain the process handle, but close the thread handle\r
-            self._child_created = True\r
-            self._handle = hp\r
-            self.pid = pid\r
-            ht.Close()\r
-\r
-            if p2cread is not None:\r
-                p2cread.Close()\r
-            if c2pwrite is not None:\r
-                c2pwrite.Close()\r
-            if errwrite is not None:\r
-                errwrite.Close()\r
-\r
 ## Launch an external program\r
 #\r
 # This method will call subprocess.Popen to execute an external program with\r
 ## Launch an external program\r
 #\r
 # This method will call subprocess.Popen to execute an external program with\r
@@ -273,10 +232,7 @@ def LaunchCommand(Command, WorkingDir):
     EndOfProcedure = None\r
     try:\r
         # launch the command\r
     EndOfProcedure = None\r
     try:\r
         # launch the command\r
-        if sys.platform == "win32":\r
-          Proc = WinPopen(Command, stdout=PIPE, stderr=PIPE, env=os.environ, cwd=WorkingDir, bufsize=-1)\r
-        else:\r
-          Proc = Popen(Command, stdout=PIPE, stderr=PIPE, env=os.environ, cwd=WorkingDir, bufsize=-1)\r
+        Proc = Popen(Command, stdout=PIPE, stderr=PIPE, env=os.environ, cwd=WorkingDir, bufsize=-1)\r
 \r
         # launch two threads to read the STDOUT and STDERR\r
         EndOfProcedure = Event()\r
 \r
         # launch two threads to read the STDOUT and STDERR\r
         EndOfProcedure = Event()\r