a crucial close() to prevent too-many-open-files
--HG-- branch : trunk
This commit is contained in:
parent
cf255cd643
commit
f552749de6
|
@ -58,6 +58,7 @@ class FDCapture:
|
||||||
if self.targetfd == 0 and not self.tmpfile:
|
if self.targetfd == 0 and not self.tmpfile:
|
||||||
fd = os.open(devnullpath, os.O_RDONLY)
|
fd = os.open(devnullpath, os.O_RDONLY)
|
||||||
os.dup2(fd, 0)
|
os.dup2(fd, 0)
|
||||||
|
os.close(fd)
|
||||||
if hasattr(self, '_oldsys'):
|
if hasattr(self, '_oldsys'):
|
||||||
setattr(sys, patchsysdict[self.targetfd], DontReadFromInput())
|
setattr(sys, patchsysdict[self.targetfd], DontReadFromInput())
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue