summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2011-03-15 20:03:32 (GMT)
committerBrett Cannon <brett@python.org>2011-03-15 20:03:32 (GMT)
commit71f1363c349c6ccab38870d328cee4de9081c8f9 (patch)
treef06eaefd5911d935c366b3f5179735648aebee1a /Modules
parentb880c1558e8562351e75837e1ba2932ae5d17111 (diff)
parentc15799f88a8add3c40bee7692b525d8a9182e491 (diff)
downloadcpython-71f1363c349c6ccab38870d328cee4de9081c8f9.zip
cpython-71f1363c349c6ccab38870d328cee4de9081c8f9.tar.gz
cpython-71f1363c349c6ccab38870d328cee4de9081c8f9.tar.bz2
merge
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_posixsubprocess.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_posixsubprocess.c b/Modules/_posixsubprocess.c
index 0f85da9..bf10cbb 100644
--- a/Modules/_posixsubprocess.c
+++ b/Modules/_posixsubprocess.c
@@ -99,10 +99,10 @@ static void child_exec(char *const exec_array[],
if (p2cread > 2) {
POSIX_CALL(close(p2cread));
}
- if (c2pwrite > 2) {
+ if (c2pwrite > 2 && c2pwrite != p2cread) {
POSIX_CALL(close(c2pwrite));
}
- if (errwrite != c2pwrite && errwrite > 2) {
+ if (errwrite != c2pwrite && errwrite != p2cread && errwrite > 2) {
POSIX_CALL(close(errwrite));
}