diff PC/_subprocess.c @ 63815:e41ca6672f82

Issue #3210: Revert C module changes and apply patch from Hirokazu Yamamoto instead
author Tim Golden <mail@timgolden.me.uk>
date Sun, 08 Aug 2010 11:18:16 +0000
parents ad292fce79f9
children f3d5837e31b7
line wrap: on
line diff
--- a/PC/_subprocess.c	Sun Aug 08 01:30:45 2010 +0000
+++ b/PC/_subprocess.c	Sun Aug 08 11:18:16 2010 +0000
@@ -429,7 +429,6 @@
     PyObject* env_mapping;
     Py_UNICODE* current_directory;
     PyObject* startup_info;
-    DWORD error;
 
     if (! PyArg_ParseTuple(args, "ZZOOiiOZO:CreateProcess",
                            &application_name,
@@ -479,22 +478,8 @@
 
     Py_XDECREF(environment);
 
-    if (! result) {
-        error = GetLastError();
-        if(si.hStdInput != INVALID_HANDLE_VALUE) {
-            CloseHandle(si.hStdInput);
-            si.hStdInput = INVALID_HANDLE_VALUE;
-        }
-        if(si.hStdOutput != INVALID_HANDLE_VALUE) {
-            CloseHandle(si.hStdOutput);
-            si.hStdOutput = INVALID_HANDLE_VALUE;
-        }
-        if(si.hStdError != INVALID_HANDLE_VALUE) {
-            CloseHandle(si.hStdError);
-            si.hStdError = INVALID_HANDLE_VALUE;
-        }
-        return PyErr_SetFromWindowsErr(error);
-    }
+    if (! result)
+        return PyErr_SetFromWindowsErr(GetLastError());
 
     return Py_BuildValue("NNii",
                          sp_handle_new(pi.hProcess),