@@ -1349,8 +1349,8 @@ def _get_handles(self, stdin, stdout, stderr):
1349
1349
if p2cread is None :
1350
1350
p2cread , _ = _winapi .CreatePipe (None , 0 )
1351
1351
p2cread = Handle (p2cread )
1352
- _winapi .CloseHandle (_ )
1353
1352
err_close_fds .append (p2cread )
1353
+ _winapi .CloseHandle (_ )
1354
1354
elif stdin == PIPE :
1355
1355
p2cread , p2cwrite = _winapi .CreatePipe (None , 0 )
1356
1356
p2cread , p2cwrite = Handle (p2cread ), Handle (p2cwrite )
@@ -1369,8 +1369,8 @@ def _get_handles(self, stdin, stdout, stderr):
1369
1369
if c2pwrite is None :
1370
1370
_ , c2pwrite = _winapi .CreatePipe (None , 0 )
1371
1371
c2pwrite = Handle (c2pwrite )
1372
- _winapi .CloseHandle (_ )
1373
1372
err_close_fds .append (c2pwrite )
1373
+ _winapi .CloseHandle (_ )
1374
1374
elif stdout == PIPE :
1375
1375
c2pread , c2pwrite = _winapi .CreatePipe (None , 0 )
1376
1376
c2pread , c2pwrite = Handle (c2pread ), Handle (c2pwrite )
@@ -1389,8 +1389,8 @@ def _get_handles(self, stdin, stdout, stderr):
1389
1389
if errwrite is None :
1390
1390
_ , errwrite = _winapi .CreatePipe (None , 0 )
1391
1391
errwrite = Handle (errwrite )
1392
- _winapi .CloseHandle (_ )
1393
1392
err_close_fds .append (errwrite )
1393
+ _winapi .CloseHandle (_ )
1394
1394
elif stderr == PIPE :
1395
1395
errread , errwrite = _winapi .CreatePipe (None , 0 )
1396
1396
errread , errwrite = Handle (errread ), Handle (errwrite )
@@ -1696,9 +1696,9 @@ def _get_handles(self, stdin, stdout, stderr):
1696
1696
pass
1697
1697
elif stdin == PIPE :
1698
1698
p2cread , p2cwrite = os .pipe ()
1699
+ err_close_fds .extend ((p2cread , p2cwrite ))
1699
1700
if self .pipesize > 0 and hasattr (fcntl , "F_SETPIPE_SZ" ):
1700
1701
fcntl .fcntl (p2cwrite , fcntl .F_SETPIPE_SZ , self .pipesize )
1701
- err_close_fds .extend ((p2cread , p2cwrite ))
1702
1702
elif stdin == DEVNULL :
1703
1703
p2cread = self ._get_devnull ()
1704
1704
elif isinstance (stdin , int ):
@@ -1711,9 +1711,9 @@ def _get_handles(self, stdin, stdout, stderr):
1711
1711
pass
1712
1712
elif stdout == PIPE :
1713
1713
c2pread , c2pwrite = os .pipe ()
1714
+ err_close_fds .extend ((c2pread , c2pwrite ))
1714
1715
if self .pipesize > 0 and hasattr (fcntl , "F_SETPIPE_SZ" ):
1715
1716
fcntl .fcntl (c2pwrite , fcntl .F_SETPIPE_SZ , self .pipesize )
1716
- err_close_fds .extend ((c2pread , c2pwrite ))
1717
1717
elif stdout == DEVNULL :
1718
1718
c2pwrite = self ._get_devnull ()
1719
1719
elif isinstance (stdout , int ):
@@ -1726,9 +1726,9 @@ def _get_handles(self, stdin, stdout, stderr):
1726
1726
pass
1727
1727
elif stderr == PIPE :
1728
1728
errread , errwrite = os .pipe ()
1729
+ err_close_fds .extend ((errread , errwrite ))
1729
1730
if self .pipesize > 0 and hasattr (fcntl , "F_SETPIPE_SZ" ):
1730
1731
fcntl .fcntl (errwrite , fcntl .F_SETPIPE_SZ , self .pipesize )
1731
- err_close_fds .extend ((errread , errwrite ))
1732
1732
elif stderr == STDOUT :
1733
1733
if c2pwrite != - 1 :
1734
1734
errwrite = c2pwrite
0 commit comments