@@ -1347,8 +1347,8 @@ def _get_handles(self, stdin, stdout, stderr):
1347
1347
if p2cread is None :
1348
1348
p2cread , _ = _winapi .CreatePipe (None , 0 )
1349
1349
p2cread = Handle (p2cread )
1350
- _winapi .CloseHandle (_ )
1351
1350
err_close_fds .append (p2cread )
1351
+ _winapi .CloseHandle (_ )
1352
1352
elif stdin == PIPE :
1353
1353
p2cread , p2cwrite = _winapi .CreatePipe (None , 0 )
1354
1354
p2cread , p2cwrite = Handle (p2cread ), Handle (p2cwrite )
@@ -1367,8 +1367,8 @@ def _get_handles(self, stdin, stdout, stderr):
1367
1367
if c2pwrite is None :
1368
1368
_ , c2pwrite = _winapi .CreatePipe (None , 0 )
1369
1369
c2pwrite = Handle (c2pwrite )
1370
- _winapi .CloseHandle (_ )
1371
1370
err_close_fds .append (c2pwrite )
1371
+ _winapi .CloseHandle (_ )
1372
1372
elif stdout == PIPE :
1373
1373
c2pread , c2pwrite = _winapi .CreatePipe (None , 0 )
1374
1374
c2pread , c2pwrite = Handle (c2pread ), Handle (c2pwrite )
@@ -1387,8 +1387,8 @@ def _get_handles(self, stdin, stdout, stderr):
1387
1387
if errwrite is None :
1388
1388
_ , errwrite = _winapi .CreatePipe (None , 0 )
1389
1389
errwrite = Handle (errwrite )
1390
- _winapi .CloseHandle (_ )
1391
1390
err_close_fds .append (errwrite )
1391
+ _winapi .CloseHandle (_ )
1392
1392
elif stderr == PIPE :
1393
1393
errread , errwrite = _winapi .CreatePipe (None , 0 )
1394
1394
errread , errwrite = Handle (errread ), Handle (errwrite )
@@ -1678,9 +1678,9 @@ def _get_handles(self, stdin, stdout, stderr):
1678
1678
pass
1679
1679
elif stdin == PIPE :
1680
1680
p2cread , p2cwrite = os .pipe ()
1681
+ err_close_fds .extend ((p2cread , p2cwrite ))
1681
1682
if self .pipesize > 0 and hasattr (fcntl , "F_SETPIPE_SZ" ):
1682
1683
fcntl .fcntl (p2cwrite , fcntl .F_SETPIPE_SZ , self .pipesize )
1683
- err_close_fds .extend ((p2cread , p2cwrite ))
1684
1684
elif stdin == DEVNULL :
1685
1685
p2cread = self ._get_devnull ()
1686
1686
elif isinstance (stdin , int ):
@@ -1693,9 +1693,9 @@ def _get_handles(self, stdin, stdout, stderr):
1693
1693
pass
1694
1694
elif stdout == PIPE :
1695
1695
c2pread , c2pwrite = os .pipe ()
1696
+ err_close_fds .extend ((c2pread , c2pwrite ))
1696
1697
if self .pipesize > 0 and hasattr (fcntl , "F_SETPIPE_SZ" ):
1697
1698
fcntl .fcntl (c2pwrite , fcntl .F_SETPIPE_SZ , self .pipesize )
1698
- err_close_fds .extend ((c2pread , c2pwrite ))
1699
1699
elif stdout == DEVNULL :
1700
1700
c2pwrite = self ._get_devnull ()
1701
1701
elif isinstance (stdout , int ):
@@ -1708,9 +1708,9 @@ def _get_handles(self, stdin, stdout, stderr):
1708
1708
pass
1709
1709
elif stderr == PIPE :
1710
1710
errread , errwrite = os .pipe ()
1711
+ err_close_fds .extend ((errread , errwrite ))
1711
1712
if self .pipesize > 0 and hasattr (fcntl , "F_SETPIPE_SZ" ):
1712
1713
fcntl .fcntl (errwrite , fcntl .F_SETPIPE_SZ , self .pipesize )
1713
- err_close_fds .extend ((errread , errwrite ))
1714
1714
elif stderr == STDOUT :
1715
1715
if c2pwrite != - 1 :
1716
1716
errwrite = c2pwrite
0 commit comments