summaryrefslogtreecommitdiffstats
path: root/PC
diff options
context:
space:
mode:
authorTim Golden <mail@timgolden.me.uk>2010-08-08 11:18:16 (GMT)
committerTim Golden <mail@timgolden.me.uk>2010-08-08 11:18:16 (GMT)
commitad537f23e2e60b92c67fe01855ec1a0a7479df46 (patch)
tree1d64176388fcd7d512c4b8f106de2d528eb9288f /PC
parentafdeca980de5bf1385bce1e7d56a56d75b7b5734 (diff)
downloadcpython-ad537f23e2e60b92c67fe01855ec1a0a7479df46.zip
cpython-ad537f23e2e60b92c67fe01855ec1a0a7479df46.tar.gz
cpython-ad537f23e2e60b92c67fe01855ec1a0a7479df46.tar.bz2
Issue #3210: Revert C module changes and apply patch from Hirokazu Yamamoto instead
Diffstat (limited to 'PC')
-rw-r--r--PC/_subprocess.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/PC/_subprocess.c b/PC/_subprocess.c
index 2a3207b..5132a5e 100644
--- a/PC/_subprocess.c
+++ b/PC/_subprocess.c
@@ -429,7 +429,6 @@ sp_CreateProcess(PyObject* self, PyObject* args)
PyObject* env_mapping;
Py_UNICODE* current_directory;
PyObject* startup_info;
- DWORD error;
if (! PyArg_ParseTuple(args, "ZZOOiiOZO:CreateProcess",
&application_name,
@@ -479,22 +478,8 @@ sp_CreateProcess(PyObject* self, PyObject* args)
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),